local date |
[eluser]Ngulo[/eluser]
hi everyone guys, i was trying to keep my db data dates and make them to local format but i think that i can't do it using simple CI date_helper i have all my dates written as so: 2010-08-07 13:00:03 and i want to put them into local date for all countries....is this possible? thanks a lot
[eluser]Vega[/eluser]
You will need to convert the mysql datetime into a unix timestamp - (You might find this helpful: http://codeigniter.com/wiki/MySQL_DATETIME_Helper/), then add or subtract the number of seconds you want to offset that time by (1 hour = 3600 seconds). Then just convert that new timestamp into whatever you want using the date() function. |
Welcome Guest, Not a member yet? Register Sign In |