Tag Archives: MySQL Queries

How to write current time to GMT in one MySQL query in UNIX timestamp?

SELECT UNIX_TIMESTAMP(CONVERT_TZ(CURRENT_TIMESTAMP,’+05:30′,’+00:00′));

 

o/p

1380010908

How to write current time to GMT in one MySQL query?

SELECT CONVERT_TZ(CURRENT_TIMESTAMP,’+05:30′,’+00:00′)

 

o/p

2013-09-24 13:49:56

How to get time in ‘2012-10-16 00:00:00’ format from unix timestamp?

SELECT FROM_UNIXTIME(1380030402)

 

o/p

2013-09-24 19:16:42

How to store value in UNIX timestamp?

SELECT UNIX_TIMESTAMP()

o/p

1380030402