Date: Tue, 18 Jun 1996 01:32:55 +0200
Reply-To: REXX Programming discussion list <REXXLIST@UGA.CC.UGA.EDU>
Sender: REXX Programming discussion list <REXXLIST@UGA.CC.UGA.EDU>
From: Erik Mogensen <erikmo@OSLONETT.NO>
Organization: SN Internett
Subject: Re: time converter for OS/2
In article <REXXLIST6061016103518@UGA.CC.UGA.EDU>,
B Sacco <SYSF80@VMMAIL.TEALE.CA.GOV> wrote:
>From: Bruce Sacco
>Subject: RE: time converter for OS/2
>On Wed, 5 Jun 1996 06:12:05 -0700, Alan Stinsonwrote:
>>Does anyone know of a library for OS/2 that would include a time
>>ie. Add 8 hours to 22:00 to be smart enough to know that would be
>>tomorrow at 6am.
>It's not a dll but it will do what you want. It will return the ending
>time in military format given the starting time and the duration in total
>minutes. In your example this would be "ADDTIME 22:00 480" giving "06:00".
In fact, the new Object Rexx which is part of the OpenDoc runtimes
has a few neat extensions to the Date() and Time() functions.
You can convert a time from one format to another,
eg. from 'Civil' (12:34p) to 'Normal' (12:34:00) like this:
say time('N', '12:34p', 'C')
You can convert to/from any format other than E and R, obviously. the
Date() equivalent cannot use D, L, M, W, obviously...
That way, you could easily convert the dates to 'S' for seconds since
midnight, and add the number of seconds you want to calculate, and if the
answer is bigger than '60*60*24' then subtract this and add 1 to the day
using the same algorithm (convert to julian numer, add 1, convert back
to normal date).
It's VERY handy!
Say date('B', '12/25/96', 'U') - Date('B') 'shopping days til X-mas!