Jump to content

[SOLVED] Date Help


beav33

Recommended Posts

it would be your server's time. so find out what your servers time zone is. then grab the users time zone and + or - the correct amount to get there time.

 

it's time consuming to code for that..why don u just use a standard one for all? i'm pretty sure the user not really care about it (timezone). just follow GMT will do....

some people prefer to show dates in the users timezone. it wouldnt really take to much extra code either.

Link to comment
Share on other sites

what i mean is that we got a lot of other important function to implement...spending time in this a waste for me in my opinion...but is ok....good luck....

 

i can see where your coming from, it may seem like a waste of time. but it has a lot of benefits. It is a lot more user friendly, because some users can become very confused about the time.

Link to comment
Share on other sites

this will help you, took me a while to figure this out, and luckly, i think is in your timezone, so you dont have to change the figures:

<?php 
$timezones = array(
		'-25200' => 'International Date Line (West) GMT-12',
		'-21600' => 'Midway Island, Samoa GMT-11',
		'-18000' => 'Hawaii, Honolulu GMT-10',
		'-14400' => 'Alaska GMT-9',
		'-10800' => 'Pacific Standard Time, US, Canada GMT-8',
		'-7200' => 'British Columbia N.E., Santa Fe, Mountain Time GMT-7',
		'-3600' => 'Central America, Chicago, Guatamala, Mexico City GMT-6',
		'0' => 'US, Canada, Bogota, Boston, New York GMT-5',
		'+3600' => 'Canada, Santiago, Atlantic Standard Time GMT-4',
		'+7200' => 'Brazilia, Buenos Aires, Georgetown, Greenland GMT-3',
		'+10800' => 'Mid-Atlantic GMT-2',
		'+14400' => 'Azores, Cape Verde Is., Western Africa Time GMT-1',
		'+18000' => 'London, Iceland, Ireland, Morocco, Portugal GMT',
		'+21600' => 'Amsterdam, Berlin, Bern, Madrid, Paris, Rome, GMT+1',
		'+25200' => 'Athens, Cairo, Cape Town, Finland, Greece, Israel GMT+2',
		'+28800' => 'Ankara, Aden, Baghdad, Beruit, Kuwait, Moscow GMT+3',
		'+32400' => 'Abu Dhabi, Baku, Kabul, Tehran, Tbilisi, Volgograd GMT+4',
		'+36000' => 'Calcutta, Colombo, Islamabad, Madras, New Dehli GMT+5',
		'+39600' => 'Almaty, Dhakar, Kathmandu, Colombo, Sri Lanka GMT+6',
		'+43200' => 'Bangkok, Hanoi, Jakarta, Phnom Penh, Australia GMT+7',
		'+46800' => 'Taipei, Beijing, Hong Kong, Singapore, GMT+8',
		'+50400' => 'Seoul, Tokyo, Central Australia GMT+9',
		'+54000' => 'Brisbane, Canberra, Guam, Melbourne, Sydney, GMT+10',
		'+57600' => 'Magadan, New Caledonia, Solomon Is. GMT+11',
		'+61200' => 'Auckland, Fiji, Kamchatka, Marshall, Wellington, GMT+12',);
?>

what you have to do is to:

$time = strtotime{"now");
$time = $time + $timeoffset//which of the figure above^
echo date("H:i:s", $time);

Ted

Link to comment
Share on other sites

Ok on a new mission. Killed the time issue and will address it later, but I still want the date to be on central U.S. Yahoo goes off international Greenwich. So how do I subtract 6 hours with this code.

<?php echo date('M d, Y');?>

Thanks Beav33

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.