Welcome Guest, Not a member yet? Register   Sign In
The best way to store date/time in MySQL for use with 'date' helper?
#3

[eluser]WanWizard[/eluser]
Store all date information in the database, as a timestamp, in GMT.
To deal with the conversion to and from a GMT date, it depends on your requirements.

If you don't care about correct conversions, or about dates in the past, you can use CI's simple date functions.

If you do care, and your using PHP 5.2+, you can use PHP's DateTime class to convert from local to GMT and back. Check out our date helper.

If you're using pre PHP 5.2, you're out of luck, since you would have to emulate the DateTime class. If you use our date helper, you will need our timezone helper as well. Note that it requires lots of memory.


Messages In This Thread
The best way to store date/time in MySQL for use with 'date' helper? - by El Forum - 06-14-2010, 12:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB