Question:
mysql help needed wit timestamp?
Asad K
2011-06-28 08:43:46 UTC
i am trying to assign a time stamp to every single entry of my database. and i want to make this auto increment for example
Time Entry
1:00 1
1:01 2
1:01 3

the problem is that when i try to do that in mysql it says
#1063 - Incorrect column specifier for column 'Time'
any help?
Three answers:
raina_vissora
2011-06-28 09:27:25 UTC
Are you saying that you want to auto-increment the Time column? If that's the case, you can't do that as you have it set up right now. To auto-increment, a column MUST be of one of the integer types (TINYINT, SMALLINT, INTEGER, or BIGINT).
2016-03-01 06:44:41 UTC
Prior to inserting/updating the mysql record can you capture the current date/time and convert it to your desired format (add subtract UTC ?), get the long/unixtime value of it then use mysql's FROM_UNIXTIME function to store it?
?
2011-06-28 08:49:17 UTC
the key word is TIMESTAMP



RTM

http://dev.mysql.com/doc/refman/5.1/en/datetime.html


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...