Subject: clock command: proposals - DN [1]
harvey.davies@dar.csiro.au - 31 May 2000 - comp.lang.tcl
1. I propose a new subcommand "clock cpu" which would give CPU time used
in seconds as defined by the standard C expression "clock()/CLK_TCK".
2. ISO 8601 allows a time zone suffix such as "+08:00" (8 hours ahead of
UTC), "-09:30" (9.5 hours behind UTC) and "Z" (UTC). Tcl currently
allows "-0930" but not "+0930" or "-09:30" or "Z" (which can be
specified as "-0000"). I propose allowing all such ISO time zone
suffixes.
3. It would be nice to have an easy way of producing ISO 8601 strings.
I suggest a new subcommand as follows:
clock iso <clockValue> ?<timeZone>?
where <timeZone> defaults to the local zone.
So command
% clock iso 5 +10:00
would produce
1970-01-01T10:00:05+10:00
4. The current version contains a list of time-zone names and rules for
deciding when daylight saving starts and finishes in each zone. It
may be useful to support these for USA, but it is quite impractical
to do it for the whole globe. The rules for daylight saving in
my country (Australia) vary from state to state and from year to
year. Why not just use the explicit numeric zones as in ISO 8601?
5. The current version stores <clockValue> as an integer number of
seconds from 1970-01-01T00:00Z. I would prefer a 64-bit float to
allow fractions of a second. Astronomers and other scientists often
measure time in days from 1858-11-17T00:00Z and this is called a
"modified Julian date" or MJN. Note that adoption of this system
would give a resolution of about a microsecond this year (2000).
I propose using this system.
Sent via Deja.com http://www.deja.com/
Before you buy.
Last modified
2000-07-20
2000-07-20
(195.108.246.52)
Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated
