convert date and time to integer

hi,

Please assist how can we convert date and time value to integer?



Thanks
FrankPorterAsked:
Who is Participating?
 
VoteyDiscipleCommented:
If you're trying to get a PHP timestamp, the way to do it is just:

SELECT UNIX_TIMESTAMP(column_name)
FROM the_table;

0
 
mherchlCommented:
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

can you give an example, what you exactly want to do?

0
 
Raynard7Commented:
I'd reccomend that you use UNIX_TIMESTAMP

however you could also use a number yyyymmddhhnnss which would also be an integer (the maths would not be good with it either)
Date_Format(now(), '%Y%m%d%H%i%S')
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.