P.S. mysql appears to be storing it as 'YYYY-MM-DD hh:mm:ss', whether that makes any difference (am I able to change that?)
Mike.
Hi all,
My web server is based in the US somewhere. I've got info being inserted into mysql on the webserver, with a timestamp auto-updating. However when I display this info on my web page it shows it as being 2am instead of 8pm.
Can I:
I don't appear to have access to the configuration to set my timezone. I am going to contact the webhost support to see if I have access to change this, but I'm not holding my breath...
- somehow tell mySQL to add 18 hours when auto-updating the timestamp?
- Tell PHP to treat the value coming from the timestamp field as date/time and add 18 hours (therefore often the next day)?
Anyone have any suggestions?
Cheers,
Mike.
what are you doing looking in here?
P.S. mysql appears to be storing it as 'YYYY-MM-DD hh:mm:ss', whether that makes any difference (am I able to change that?)
Mike.
what are you doing looking in here?
Use one of the many timezone-setting functions (e.g. date_default_timezone_set()), or the date.timezone ini setting.
Staying away from PF1, due to the ongoing excessive number of political complaint threads. A few is fine, but not the complete inundation of the last few months; PressF1 is no longer what it used to be. I will still respond to PMs.
Thanks Erayd, that pointed me in the right direction. I needed to convert the timestamp to unix-time or something first for it to work, and then everything has worked from there.
Cheers,
Mike.
what are you doing looking in here?
Staying away from PF1, due to the ongoing excessive number of political complaint threads. A few is fine, but not the complete inundation of the last few months; PressF1 is no longer what it used to be. I will still respond to PMs.
Bookmarks