In my MySQL database I have 2 raws with timestamp data type . And I have datepickers in the front end with 2 fields (I am picking values MM/DD/YYYY from datepicker) . And when I write my SQL query using to pull out the time of that 2 timestamp raws using sql’s UNIX_TIMESTAMP(table_name.column_name) and comparing with the same date picked from the date jQuery’s datepicker apprears (after calculations) that datepicker’s time is 4 hours ahead . How come ? I spent my whole past day not even thinking that could be my problem…
And now to have no conflicts I am comparing mysql’s unix_timesatmp(table_name.column_name) with datepicker’s time-14400 (4 hours = 14400s) .
So how do you see an easier way of sorting this out and doesnt this seem weird to you ?
In my MySQL database I have 2 raws with timestamp data type . And
Share
Check the timezone on the server (which is what MySQL uses) vs. the timezone on your computer (which is what javascript/jQuery uses).
If that doesn’t cover it, need more information about what exactly you’re trying to accomplish.