drew

Words on your display.

Archive for May, 2009

Converting Ticks to a Timestamp

with 2 comments

I recently had to deal with a SQLite database that stored the timestamps as ticks.  Having to first research what a tick is, I created a simple function that will convert a tick value to a timestamp or MySQL datetime value since I couldn’t find anyone else who had done such a thing yet.

You can download it here.

The only tricky part (aside from figuring out what a tick is) was calculating the number of ticks between 0001-01-01 to 1970-01-01. Also of note: a tick is apparently a popular way to store date/time values for Microsoft.

Written by Drew

May 2nd, 2009 at 3:12 pm

Posted in PHP, Programming, WebDev

Tagged with , , ,