<?php $date1 = 'Tue, 01 May 2007 09:31:55 EDT'; $date2 = 'Thu, 26 Apr 2007 06:44:00 PDT'; $date3 = 'Tue, 01 May 2007 14:07:26 GMT'; ?> PHP: Is there an easy way to convert all these dates to GMT values even if I don't know what the timezone will be every time?
you can get the gmt offset via javascript with getTimezoneOffset(), but if you have the dates stored in php, that complicates things a bit.
you have the gmdate() functions which outputs a GMT date. I think something like this should work. $date = 'Tue, 01 May 2007 09:31:55 EDT'; $dateGMT = gmdate('D, d M Y H:i:s',strtotime(substr($date,-3,3),substr($date,0,-4))); PHP: