View Full Version : Date in certain Timezone
stewie316
04-09-2008, 09:28 PM
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
Medyman
04-09-2008, 11:22 PM
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
stewie316
04-10-2008, 03:46 AM
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. ><
Medyman
04-10-2008, 12:36 PM
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?
hmsnacker123
04-10-2008, 03:12 PM
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.