rekha,

mysql> select date_format(dateEntered, "%m-%d-%Y %H:%I") as dateEntered, 
    -> date_format(date_add(dateEntered, interval 2 hour), "%m-%d-%Y %H:%I")
as '2 Hours Later'
    -> from newsStories where storyID = 1122;
+------------------+------------------+
| dateEntered      | 2 Hours Later    |
+------------------+------------------+
| 03-28-2001 20:08 | 03-28-2001 22:08 |
+------------------+------------------+
1 row in set (0.00 sec)

Both DATE_FORMAT, DATE_ADD *are* in the manual....

http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Dat
e_and_time_functions

chris

-----Original Message-----
From: Rekha Das [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 02, 2001 2:52 PM
To: '[EMAIL PROTECTED]'
Subject: Time function


What time function should I use to add 2 hours to a time value I am getting
from the database ?

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to