the statement "within the same exact thousandth of a second" is not correct. The /precise
refinement still can get only the system time, so the "granularity" of the time you can
get depends on the operating system you use. Some values:
Windows 95/98 55 ms
Windows NT 10 ms
The value for the granularity can be easily computed with my TIME-TICK function, that
can be found in http://www.sweb.cz/LMecir/timblk.r
I have updated my 'time-in-digits function so that it can be
> used with
the /precise refinement for 'now.
I use 'time-in-digits
> exhaustively, because it can be used to create
sequential session IDs
> over time and to create sequential file names
> can now handle the /precise refinement, it is very unlikely
> create the same session ID for multiple connections to a CGI
> (which was a possibility previously since more than one
> submit to CGI within the same exact second. Now
there would only be a
> problem if more than one person might submit
to CGI within the same
> exact thousandth of a second.)
Title: "Date and
> time in digits"
> Version: 1.3.0
Author: "Ryan C.
Owner: "Ryan C.
Rights: "Copyright (C) Ryan C. Christiansen 2000"
> Tabs: 4
Convert the date
> and time into a string of digits.
> function to create a string of digits denoting
the date and time.
> This is useful, especially for creating
sequential session IDs.
> If used with 'now to create a file
name, the newest file will
> always appear at the end of
> 1.0.0 [12-June-2000 "posted to rebol.com" "Ryan"]
> [28-Dec-2000 "updated for /precise refinement" "Ryan"]
> Category: [util 2]
time-in-digits: func [
"Convert the date and
> time from 'now' into a string of digits."
sun-dial [date!] "The
> current date and time from 'now'"
year: to-string sun-dial/year
> month: to-string sun-dial/month
if (length? month) < 2 [insert
> month "0"]
day: to-string sun-dial/day
if (length? day) < 2
> [insert day "0"]
if (length? hour) < 2 [insert hour "0"]
> minutes: to-string current-time/minute
if (length? minutes) < 2
> [insert minutes "0"]
seconds: to-string current-time/second
> seconds-rounded: make integer! current-time/second
> current-time/second = seconds-rounded [
> partial-seconds: "000"
either seconds-rounded = 0 [
> whole-seconds: "00"
time-string: make string! (reform
split-time: parse/all time-string "."
> partial-seconds: second split-time
> current-time/second = 0 [
> partial-seconds: "000"
> seconds "."
whole-seconds: first split-seconds
> partial-seconds: second split-seconds
> [(length? whole-seconds) < 2][insert whole-seconds "0"]
> [(length? partial-seconds) < 3][append partial-seconds "0"]
> rejoin [year month day hour minutes whole-seconds partial-seconds]
> > This appears to work until the thousandths-of-a-second value reaches
> > either 1,000 or zero (not sure how REBOL is handling this, which is
> the problem lies, I believe.)
> Probably goes from 999 and
> roll around to 0, or none.
> > ** Script Error: Out of range or past
> > ** Where: time-in-digits
> > ** Near: partial-seconds: second
> > while [(length? whole-seconds) < 2]
> 'whole-seconds is 'none ?
> I hope that helps!
> Andrew Martin
> ICQ: 26227169 http://members.nbci.com/AndrewMartin/
> > To unsubscribe from this list, please send an email to
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without
> the quotes.
To unsubscribe from this list, please send an
> email to
[rebol-request--rebol--com] with "unsubscribe" in the