tags:

views:

41

answers:

2

I wish to update just the date part of the timestamp, I don't want to change the time part, I want to do this with mysql but don't know the function or right query to use. Please help, I am a newbie to mysql.

+2  A: 

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-add

DATE_ADD(time_stamp, INTERVAL 1 DAY)

Alternatively, if you want to set the date part to an absolute value, something like

DATE_ADD(time_stamp, INTERVAL DATEDIFF('2010-12-31', time_stamp) DAY)
ptomli
A: 
mysql> SELECT NOW(), DATE_ADD(NOW(), INTERVAL 1 MONTH)
mysql> SELECT NOW(), DATE_ADD(NOW(), INTERVAL 1 DAY)
Ashwani Roy