tags:

views:

62

answers:

1

So I want to grab records from a table based on the day of the month the record was created. This information is stored in a unix timestamp. During testing I created new test records and through in some timestamps for specific day and times that I had converted to timestamps using an online converter. I used...

01/29/2010-02:00:00

Right now I'm using...

FROM_UNIXTIME(timestamp, '%d') == 29

This should work for all times on the 29th day of every month. But it is calculating the timestamp to be 5 hours behind the actual value of the timestamp. So when I just run a FROM_UNIXTIME on the timestamp it returns 01/28/2010-21:00:00. I was hoping someone could give an explanation for this, if there is an easy fix or should I just code the program to expect the timezone to be a factor.

A: 

The FROM_UNIXTIME function automatically converts the datetime to the current timezone.

Aglystas