x
login about faq Site discussion (meta-askssc)

Add time to a date?

Hi,

Is there a way to add a certain amount of time to a date, something similar to this:

add_time(date_col, '23:59:59')
more ▼

asked Jan 25 '10 at 10:28 AM in Default

user-91 (google) gravatar image

user-91 (google)
3 2 2

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Just add a number. Each day is 1, so to add an hour:

SELECT sysdate+1/24 FROM dual;

or a minute:

SELECT sysdate+1/1440 FROM dual;
more ▼

answered Jan 25 '10 at 10:35 AM

Andrew Mobbs gravatar image

Andrew Mobbs
1.5k 1 3

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x600
x28

asked: Jan 25 '10 at 10:28 AM

Seen: 452 times

Last Updated: Jan 25 '10 at 10:28 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.