Unix Technical Forum

Adding 10 hours to specific time

This is a discussion on Adding 10 hours to specific time within the MySQL forums, part of the Database Server Software category; --> Hi everyone! Just wondering: How would one add 10 hours to a specific time? Is there something similar to ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:27 AM
m.verkerk@gmail.com
 
Posts: n/a
Default Adding 10 hours to specific time

Hi everyone!

Just wondering:

How would one add 10 hours to a specific time? Is there something
similar to add an interval's to a specific time?

SELECT TIMESTAMPADD(HOUR, 10, '12:00:00');

Results with me:

+------------------------------------+
| TIMESTAMPADD(HOUR, 10, '12:00:00') |
+------------------------------------+
| NULL |
+------------------------------------+
1 row in set, 1 warning (0.00 sec)


Warning:

Truncated incorrect datetime value: '12:00:00'

Kind regards,
Marijn

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:27 AM
Martijn Tonies
 
Posts: n/a
Default Re: Adding 10 hours to specific time

Hi,

> Just wondering:
>
> How would one add 10 hours to a specific time? Is there something
> similar to add an interval's to a specific time?
>
> SELECT TIMESTAMPADD(HOUR, 10, '12:00:00');
>
> Results with me:
>
> +------------------------------------+
> | TIMESTAMPADD(HOUR, 10, '12:00:00') |
> +------------------------------------+
> | NULL |
> +------------------------------------+
> 1 row in set, 1 warning (0.00 sec)
>
>
> Warning:
>
> Truncated incorrect datetime value: '12:00:00'


This should help:
http://dev.mysql.com/doc/refman/5.0/...functions.html

select addtime(current_time, '10:00:00'), current_time


--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:25 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com