I am currently on CDT
run strtotime() of the following string now returns are:
2009-11-17 9:00:00 am
1258470000
(note: Correct return. And the return value is using CST timezone automatically even the server is on CDT now.)
2009-11-17 9:00:00 am CST
1258470000
(note: Correct return. And the return value is using CST timezone, the server is on CDT and I also asking to use CST.)
My problem is with the following:
2009-11-17 9:00:00 am CDT
1258466400
Even CDT ends after 2009-11-01, but strtotime on this "2009-11-17 9:00:00 am CDT" will still return CDT time, due to the string specifically ask so.
Should "2009-11-17 9:00:00 am CDT" still return 1258470000 the same as "
2009-11-17 9:00:00 am CST"? due to CDT already ends on that date?
Because, say the server is on CDT now, and if I am working on events which is on Eastern timezone, when I try to convert the event date (either EDT or EST depends on the date) to unix timestamp, I have to add either EDT or EST, otherwise, the unix timestamp is for CDT/CST date as default, which will be wrong.
But due to I am getting these events' date from database or so, I don't know it will be either EDT or EST, I will only know that it is East Time Zone, so if I give EDT, "2009-11-17 9:00:00 am EDT", actually I would expect is "2009-11-17 9:00:00 am EST".
Should "2009-11-17 9:00:00 am EDT" return same value as "2009-11-17 9:00:00 am EST" due to EDT already ends on 2009-11-17? But php strtotime() returns different values for "2009-11-17 9:00:00 am EDT" and "2009-11-17 9:00:00 am EST".
How do you solve the problem that if you are on CDT/CST timezone, and you are trying to covert date (Eastern time, EDT/EST) to unix timestamp but you don't know it is EDT or EST?
Or this is the old problem php has with the timezone. And the only solution is using this http://www.php.net/manual/en/function.date-default-timezone-set.php instead?
Thanks!