mysql - subtract minutes from a time value -


I have a time zone in my database, its value is 22:05

I want to Decrease by 5 minutes when the field is datetime I use sub-ditat and work fine, but I can not get it from the time zone, I get a warning; I do not know how to deal with it;

  mysql> Client Cables Select Schedule Time from WHERE clientScheduleID = 3; + ------------------- + | Scheduling Time | + ------------------- + | 22:05:00 | + ------------------- + 1 line set (0.00 seconds) mysql & gt; Client Celtul WHERE clientScheduleID = 3 to SELECT date_sub (scheduleFinaltime, interval 5 minutes); + ------------------------------------------------ + | Date_sub (schedule time, interval 5 minutes). + ------------------------------------------------ + | Faucet + ------------------------------------------------ + 1 line in set, 1 warning (0.00 seconds) mysql & gt; Show warnings; + --------- + ------ + -------------------------------- ---------------------------- + | Level | Code | Message | + --------- + ------ + -------------------------------- ---------------------------- + | Warning | 1264 | Out of range value for column 'Schedule Fitime' on line 1 --------- + ------ + ------------------ -------------- ---------------------------- + 1 line set (0.00 seconds)   

Thanks in advance

MySQL has a function.

  SUBTIME (Expr1, expr2) SUBTIME () gives expr1 ??? Expr2 has been expressed as a value in the same format as expr1. Expr1 is a time or date time expression, and expr2 is a time expression of mysql & gt; SELECT SUBTIME ('2007-12-31 23: 59: 59.999 99', '1 1: 1: 1.000002'); - & gt; '2007-12-30 22:58 58: 58.999 99 7' ISSLL & gt; Select sub-time ('01: 00: 00.999 99 9 ', '02: 00: 00.999 998'); - & gt; '-00: 59: 59.999 99 9' '   

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -