help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matcompat's datenum.m weirdness


From: Paul Kienzle
Subject: Re: Matcompat's datenum.m weirdness
Date: Thu, 30 Aug 2001 18:11:56 -0400

James Howard wrote:

> On Thu, 30 Aug 2001, E. Joshua Rigler wrote:
>
> > This definitely supports my theory that any/all date and time functions
> > should be written from scratch, and not be dependent on C/C++'s
> > libraries, which are not intended for science or engineering work.  At
> > the very least a correction should be made to the current routine for
> > timezone errors.
>
> No, that would not be the correct behavior.  When I want to know what time
> it is for a scientific application (say, the orbit tracking I was working
> on yesterday), the time must be GMT.  In general, I do not care when the
> local time is, except for knowing when to watch The West Wing.  Most any
> computer should always deal with the time in GMT.
>
> That said, datenum should take a timezone argument.  It may, but I cannot
> find this on my installation.
>
> Jamie

In Joshua's example [ datenum (yr, mon, day) ], it is pretty clear that you
ought to
be using the start of the day, not the start of the day adjusted by time
zone.  And
when you are specifying H:M:S in addition to Y/M/D, it is again pretty clear
that you
don't want them adjusted to account for the difference between local wall
clock
time and GMT.  So either way my function was definitely broken.

The question you raise, though, is what should the functions "now" and
"clock" return.
In both cases they currently return the local wall clock time.  To get UCT,
use
gmtime(time), and add 1900 to the year field.

Paul Kienzle
address@hidden



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]