For DATETIME- or TIMESTAMP-formatted strings, you can use DATE_ADD( ) to introduce a temporal context: : DATE_ADD « Date Time « SQL / MySQL






For DATETIME- or TIMESTAMP-formatted strings, you can use DATE_ADD( ) to introduce a temporal context:

      
mysql>
mysql> SELECT DATE_ADD('1999-01-01 12:30:45',INTERVAL 0 DAY)+0 AS 'numeric datetime', DATE_ADD('19990101123045',INTERVAL
 0 DAY)+0 AS 'numeric timestamp';
+------------------+-------------------+
| numeric datetime | numeric timestamp |
+------------------+-------------------+
|   19990101123045 |    19990101123045 |
+------------------+-------------------+
1 row in set (0.00 sec)

   
    
    
    
    
    
  








Related examples in the same category

1.what time will it be in 60 hours?
2.Finding Dates for Weekdays of Other Weeks
3.Finding Dates for Days of the Current Week
4.WHERE DATE_ADD(d,INTERVAL 6 MONTH) >= CURDATE( );
5.Adding a Temporal Interval to a Date
6.Shifting Dates by a Known Amount
7.Adding 3 days and 4 hours produces this result
8.Perform the week shift first