× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: TIMESTAMP and rolling time value
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Fri, 20 Jul 2001 03:29:41 -0500 (CDT)


On Fri, 20 Jul 2001, Simon Coulter wrote:
>
> Hello All,
> 
> It used to be the case that adding a time duration greater than 24 hours to 
> a timestamp data type would NOT roll the date portion of the timestamp.
> 
> I have recently discovered that this is no longer true.  Does anyone 
> remember when this change occurred?
> 

Hello Simon,

The following piece of code was written/compiled/tested on V3R2 on
my CISC machine.   It adds 31 years worth of seconds to a timestamp,
successfully changing the date from a day in 1970 to the current date.

So, either I didn't understand your question, or it worked at least as
far back as V3R2.


     D Epoch           S               Z   INZ(z'1970-01-01-00.00.00.000000')
     D Current         S               Z

     D secs            S             10U 0

     D time            PR              *   ExtProc('time')
     D   timeptr                       *   value
 
      ** note that the time displayed here is GMT, it is not
      **  adjusted for your timezone.
     c                   callp     time(%addr(secs))
     c     Epoch         adddur    secs:*S       Current
     c                   dsply                   Current

     c                   eval      *inlr = *on


> On VRM440 (and code running on 440 but compiled for 420) adding a duration 
> (either positive or negative) to a timestamp behaves the way one would 
> expect by rolling the date portion appropriately.  I'm positve that earlier 
> releases did not do that.
> 
> Regards,
> Simon Coulter.
> 



+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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-2024 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.