CodeIgniter Forums
'Best' date type: store as Unix timestamp or MySQL DATETIME? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: 'Best' date type: store as Unix timestamp or MySQL DATETIME? (/showthread.php?tid=12495)



'Best' date type: store as Unix timestamp or MySQL DATETIME? - El Forum - 10-21-2008

[eluser]Daniel H[/eluser]
Hi

I have always used DATETIME as the field type for any date related fields in MySQL. But now I'm working on a site that will have to do some timezone manipulations etc., so I will make great use of the date helper. However, I was wondering what was best practice... to store Unix formatted timestamps as, say, an INT(10) in MySQL, or do Unix/DATETIME conversions on the fly?

Bear in mind that I won't be using MySQL's own TIMESTAMP type.

Thanks,

Dan.