×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




thanks...
but....
if it is 2am on the first it won't give me 18000 seconds (5 hours)...
so I will need to have some sort of if statement...



On Mon, Oct 15, 2018 at 11:48 AM Rob Berendt <rob@xxxxxxxxx> wrote:

Although I'm having a tough time verifying the math.
values timestampdiff(2,
char(timestamp (date(cast (year(current date) +1 as char(4)) concat
'-01-01'), time('07.00.00'))
- current timestamp)); -- 6632574 seconds

values 6632574 / 60; -- 110542 minutes

values 110542 / 60; -- 1842 hours

values 1842 / 24; -- 76 days

values current date + 76 days; -- 2018-12-30


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: "Rob Berendt" <rob@xxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
Date: 10/15/2018 12:24 PM
Subject: Re: SQL for delay timer...
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



values timestampdiff(2,
char(timestamp (date(cast (year(current date) +1 as char(4)) concat
'-01-01'), time('07.00.00'))
- current timestamp));


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: "Gerald Magnuson" <gmagqcy.midrange@xxxxxxxxx>
To: "Midrange List" <midrange-l@xxxxxxxxxxxx>
Date: 10/15/2018 12:02 PM
Subject: SQL for delay timer...
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



I need to compute the number of seconds between NOW and the next January
1st, 7am...

I have:
select
TIMESTAMPDIFF(2,CHAR(TS2 - TS1))
from (
SELECT CURRENT TIMESTAMP AS TS1,
TIMESTAMP(CONCAT(
CAST(CHAR(YEAR(CURRENT DATE)+ 1) as CHAR(4)),
CHAR('-01-01-07.00.00')))as TS2
FROM SYSIBM.SYSDUMMY1 ) as data

but that won't work when it's the wee hours of January 1st (after
midnight, before 7am)...
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.