Jump to content

[SOLVED] adjust a gmt timestamp to a local time timestamp


ultrus

Recommended Posts

Hello,

I'm have a GMT timestamp created from a an rss feed that I need to convert to a local time. I was thinking about just subtracting the offset (MST -700). However, that changes depending on daylight savings correct? Any thoughts on how to convert?

 

Thanks much!

pass it to strtotime() to convert it to a timestamp...then you can use date() to reprint the date (and it will be in the timezone of the server)...example:

<?php
  $ts = strtotime('2009-04-21 14:38:00 GMT');
  print date('r',$ts);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.