want time that is 3 hours later

insert into
datetime field
values
NOW()


I want the time that is 3 hours later



NOW()+3
NOW()+30

both '2012-08-29 01:00:43'

NOW()+300
'0000-00-00 00:00:00'


how can I get
'2012-08-29 04:00:43'


I am working on godaddy shared server and I can not change mysql time
LVL 1
rgb192Asked:
Who is Participating?
 
johanntagleCommented:
Say hello to the date_add function see http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-add

date_add(now(), interval 3 hour)
0
 
Anuradha GoliSystems Development / Support SpecialistCommented:
Change ur code based on this example
UPDATE events SET date_starts = DATE_ADD(date_starts,INTERVAL 2 HOUR) WHERE event_id = 3;

Open in new window

0
 
rgb192Author Commented:
both add to date

thanks
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.