TIMESTAMPADD(unit,interval,datetime_expr) adds the integer expression interval to datetime_expr : TIMESTAMPADD : Date Time Functions MySQL TUTORIALS


MySQL TUTORIALS » Date Time Functions » TIMESTAMPADD »

 

TIMESTAMPADD(unit,interval,datetime_expr) adds the integer expression interval to datetime_expr


The unit for interval is given by the unit argument.

The unit value may be specified with a prefix of SQL_TSI_.

For example, DAY and SQL_TSI_DAY both are legal.

The unit should be one of the following values:

  1. FRAC_SECOND,
  2. SECOND,
  3. MINUTE,
  4. HOUR,
  5. DAY,
  6. WEEK,
  7. MONTH,
  8. QUARTER, or
  9. YEAR.
mysql>
mysql>
mysql> SELECT TIMESTAMPADD(MINUTE,1,'2003-01-02');
+-------------------------------------+
| TIMESTAMPADD(MINUTE,1,'2003-01-02') |
+-------------------------------------+
2003-01-02 00:01:00                 |
+-------------------------------------+
row in set (0.02 sec)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Date Time Functions
» TIMESTAMPADD