Converting a time go GMT Timestamp

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dwessell
Forum Commoner
Posts: 62
Joined: Fri Dec 23, 2005 2:30 pm

Converting a time go GMT Timestamp

Post by dwessell »

Hey all.. I have a date/time in the format of "10-03-2006 9:00 am Eastern".. Can someone point me in the direction of how to convert that to a GMT Timestamp?

Thanks
David
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

That's a fairly odd date-time format, but shouldn't be too difficult to handle. strtotime() may do most of the work, but it may get the date wrong at times and the time offset will likely be off too. Once you have it as a localized unix timestamp, you can add date('Z') to it.
Post Reply