======  Paul Gilmartin  ======  wrote    2006-10-25 17:43:
In a recent note, Lindy Mayfield said:

Date:         Wed, 25 Oct 2006 16:47:00 +0200

date=DATE(U)
time=TIME()
    ...
Say 'Rexx Date/Time:' date time

Do not do this.  There's a (small) chance that the date will change
between the two calls, and the result printed will be in error
by 24 hours; a nasty bug for being almost impossible to reproduce.
Rather, do:

  Say 'Rexx Date/Time:' DATE(U) TIME()

I recognize this is a one-off, but as mentioned recently in these
lists, one-time code has a nasty habit of creeping into production,
as do careless habits practiced in one-time code.

-- gil

There is still a small(er) chance that the date changes between the
resolution of the Date() function and the resolution of the Time()
function.  (AFAIK)
Haven't found a really "clean" solution to this problem.  Anyone ?

Thomas Berg


--

__________________________

    Mundus Vult Decipi
__________________________

 They that can give up essential liberty to obtain a little temporary safety 
deserve neither liberty nor safety.
 - Benjamin Franklin

 Military justice is to justice what military music is to music.
 - Groucho Marx

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to