JayWay
09-03-2009, 10:57 PM
I'm trying to learn/re-learn PHP and write a big script, I used to know a little but its been over 8 years and a lot has changed.
Right now I'm trying to perfect storing and altering universal dates to display in individual users timezones without a lot of unnecessary code.
What is the best method to store date/time information (past, current, future dates) in mysql... UTC timestamps in datetime columns, unix timestamps in some other column, or something else?
What is the best way to return the correct date/time to the end user (and alter as needed)... add/subtract an offset direct from the mysql query, or use a php class or function?
The script I'm going to write will be largely focussed on dates with many dates displayed and/or manipulated per page load, so I dont want to use a lot of unnecessary php code that will eat ram when run in a loop, but I also want to keep the PHP and MySQL pretty standard for use on the average web server.
I've been reading up on this as much as I can for a few days and trying to work the newer php date/timezone functions in my head, but it seems like everybody does it different and it's a lot to take in without the experience of knowing it.
I would appreciate any advice on how you handle dates so I know where to start.
Thanks.
BTW, I'm new here, so Hello.
Right now I'm trying to perfect storing and altering universal dates to display in individual users timezones without a lot of unnecessary code.
What is the best method to store date/time information (past, current, future dates) in mysql... UTC timestamps in datetime columns, unix timestamps in some other column, or something else?
What is the best way to return the correct date/time to the end user (and alter as needed)... add/subtract an offset direct from the mysql query, or use a php class or function?
The script I'm going to write will be largely focussed on dates with many dates displayed and/or manipulated per page load, so I dont want to use a lot of unnecessary php code that will eat ram when run in a loop, but I also want to keep the PHP and MySQL pretty standard for use on the average web server.
I've been reading up on this as much as I can for a few days and trying to work the newer php date/timezone functions in my head, but it seems like everybody does it different and it's a lot to take in without the experience of knowing it.
I would appreciate any advice on how you handle dates so I know where to start.
Thanks.
BTW, I'm new here, so Hello.