Re: Timestamp trouble
Hi.
I created two columns:
a "Date" column with a VARCHAR(45) datatype and
a "Date_time" column with a TIMESTAMP datatype and CURRENT_TIMESTAMP as the default value(? I'm not sure if I'm getting the terms correct.)
I then created a form with a hidden text field that inserts the current date and time using the DATE function into a MySQL table when submitted.
This is the script I'm using as the text field's default value:
date_default_timezone_set("America/New_York");
echo date("m/d/y h:ia")
The DATE column in the table displays the correct day and time: 01/06/15 1:42am
the DATE_time column only displays the correct time but the day is off by 5,000 or so days: 2001-06-15 01:42:00.
I'm not getting it.
Subject
Written By
Posted
Re: Timestamp trouble
January 06, 2015 12:45AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.