Results 1 to 5 of 5

Thread: Date in certain Timezone

  1. #1
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Date in certain Timezone

    Hi,

    I am trying to find just a "Date" in EST Timezone. Looking for it to be in possibly javascript. Been going through sites trying to find one but they all seem to come with the time just need the date.

    Example

    Wednesday 9th, 2008 But i would like it to stay in EST Timezone as i use a Flash Clock but i noticed that other people that view my site that are 2-3 hours behind me notice the time still stays to the same date as their time zome.

    Thanks

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    http://www.tizag.com/javascriptT/javascriptdate.php

    That'll give you the date with javascript. But javascript is a client side language. That means that the time that it shows will be the time for the client/user (i.e. what your system clock says).

    If you want to access a constant time, use php (or another server side language). PHP will display the time as according to your server (which remains constant regardless of where the user that's viewing the site is). You might have to adjust the time from your server if the server is located in another timezone, but that's a one time thing.
    http://us2.php.net/date

  3. #3
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    There isn't another way to get the Date not client side in javascript? No way to set it to change to the 9th on EST Time? If possible is there any way to make it happen in flash?

    Hate how it says its midnight on the 10th but for my friend it says its midnight on the 9th because the date reads his computer. ><

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by stewie316 View Post
    There isn't another way to get the Date not client side in javascript?
    No, JavaScript is a client side language. For server side operations, you need a server side language.

    Hate how it says its midnight on the 10th but for my friend it says its midnight on the 9th because the date reads his computer.
    You could have the entire thing be local. So instead of showing midnight on the 9th for him, it would say 10:00PM on the 9th or whatever the local time is. If I'm on the west coast and looking at your site, what good is it to me to know the time on the east coast?

  5. #5
    Join Date
    Mar 2008
    Posts
    122
    Thanks
    17
    Thanked 5 Times in 5 Posts

    Default

    i dont know if this would help but:

    <script type="text/javascript">
    var t = new Date()
    document.write('' + t.toGMTString())

    </script>

    but it might be wrong cos i have not used this in a long time.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •