A tool for all Windows Object Rexx users (I think) 
Author Message
 A tool for all Windows Object Rexx users (I think)

RxDateTime.dll

Another ActiveX dll that will work "wonders" on dates and times.  The
VB Runtime Files are NOT needed for this - simply use regsvr32 to
register it and away you go.

Usage MyObj = .OleObject~New("RxDateTime.Convert")

Two methods are available:
MyObj~VerDate(a_date)
Is used to verify a date and will return either .True or .False.  This
method uses the locale settings of the current Windows system to
determine if the value held within the variable is recognizable as a
date.  Therefore, what is a legal date format on one machine may fail
on another.  Use this method BEFORE the Convert method to be certain
you are passing a valid date.  Valid dates on my system include
"December 4, 2002", "12/04/2002", "12/04/02", "December 4, 2002 3:02
PM", etc.

MyObj~Convert(interval,number,date)
Is used to add or substract the "number" from the "date" based on the
"interval". All 3 parameters to this method are REQUIRED.
interval
        yyyy = Year
        q = Quarter
        m = Month
        y = Day of year
        d = Day
        w = Weekday
        ww = Week
        h = Hour
        n = Minute
        s = Second
number
        Must be a whole number (+ or -)
date
        Can be in numerous formats (see VerDate method).  This can be
made up of 2 parts, the date and the time.
        Example: "12/02/2002 4:53 PM".  If the year portion is not
provided, then 01/01/1900 will be used as the base date.  
        Date can go back as far as 100 A.D. and as far in the future
as 9999 A.D.

/* testrxdt.cmd */
myobj = .OleObject~New("RxDateTime.Convert")

adate = 'September 31, 2002'
if myobj~VerDate(adate) then
        say adate 'is Valid'
else
        say adate 'is InValid'

adate = date('u')
if myobj~VerDate(adate) then
        say adate 'is Valid'
else
    do  
        say adate 'is InValid'
        exit
    end

say '3 Days added to' adate '=' myobj~dateconvert('d',3,adate)
say '135 minutes added to' adate 'at 11:04 PM ='
myobj~dateconvert('n',135,adate "11:04 PM")
say '12 hours 15 minutes prior to the current date/time was'
myobj~dateconvert('n',-((12*60)+15),date('u')  time('c'))
say '12 hours 15 minutes added to the current date/time will be'
myobj~dateconvert('n',(12*60)+15,date('u') time('c'))

C:\RxDateTime>rexx testrxdt.cmd
September 31, 2002 is InValid
12/04/02 is Valid
3 Days added to 12/04/02 = 12/7/2002
135 minutes added to 12/04/02 at 11:04 PM = 12/5/2002 1:19:00 AM
12 hours 15 minutes prior to the current date/time was 12/4/2002
2:44:00 AM
12 hours 15 minutes added to the current date/time will be 12/5/2002
3:14:00 AM

C:\RxDateTime>

You know where to find it ( http://www.*-*-*.com/ )  I
will be glad to provide more samples if you don't quite understand the
"interval".

Lee



Mon, 23 May 2005 04:13:50 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Thinking about WinHelp Tools? Think $$$

2. Support for REXX and Object REXX for Windows/AIX

3. Conversion OS/2 Rexx to Object Rexx for Windows '95

4. Announce: Update for Object REXX for Windows 95/Windows NT available

5. tk tool kit and Object Rexx for Linux

6. End User Ad Hoc/Inquery Report Tools for Windows

7. Free Rexx Development Tool (OS/2, DOS, Windows and Unix)

8. Visual Programming tools for REXX in Windows

9. Windows Object Rexx & OODialog

10. Parse XML with Object REXX on Windows

11. Object Rexx and Windows XP

12. Accessing a Windows Dialog Box in Object REXX

 

 
Powered by phpBB® Forum Software