woolyg Posted September 24, 2009 Share Posted September 24, 2009 Hi all, I'm looking at developing a cloud application that would be hosted in the US, but each company using it would have their own 'install' on the server. I'm running through timestamping scenarios - maybe if you have the time you might add to the conversation? Because the server is in the US, if I define a global in my PHP for the exact current time, to the second as follows, it would be coded as this (say): <?php $SG_now = date("M d Y H:i:s"); //Returning 2009-09-24 13:56:26 ?> Now, say I had a customer in New Zealand, a timestamp like the one above above would be undesirable, as their timestamp for the exact same date would need to be 2009-09-25 07:56:26. Do you think using date_default_timezone_set() at the top of each page to set the current local user's time setting would work best for this type of timestamp change? If so, I'll need to allow each user to select exactly what timezone they are in when they are configuring their install, and pass that value into a $_SESSION variable. Is there a full, comprehensive list of all of the values that date_default_timezone_set() uses? I see there's one here: http://us2.php.net/manual/en/timezones.php - but it is truncated into continents. Anyone got a full list so I can easily add it into my app? If anybody has any better recommendations for parsing the local date for a user logged-in within a different timezone, please do give me some advice, I'm interested in your input. Thanks all, WoolyG Link to comment https://forums.phpfreaks.com/topic/175412-date_default_timezone_set/ Share on other sites More sharing options...
Mark Baker Posted September 24, 2009 Share Posted September 24, 2009 timezone_identifiers_list() should give a list of the available timezone values Link to comment https://forums.phpfreaks.com/topic/175412-date_default_timezone_set/#findComment-924461 Share on other sites More sharing options...
woolyg Posted September 24, 2009 Author Share Posted September 24, 2009 Excellent, thanks Mark! Wool Link to comment https://forums.phpfreaks.com/topic/175412-date_default_timezone_set/#findComment-924471 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.