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 14:07:52 -0400

change the line

    t0=mktime(localtime(0));

to

    lt=localtime(0);
    t0=mktime(lt);
    h=h+lt.hour-24;

That should fix it for now.   The bigger problem is that dates are presently
limited to about 1902-2037.
Feel free to send me a new function not based on the C library.

Paul Kienzle
address@hidden

"E. Joshua Rigler" wrote:

> I'm not sure what you mean.  I certainly shouldn't have to change my
> timezone setting on my system.  Is there a way to do this within
> Octave?  If timezone is indeed the reason for this error, (and 7/24, my
> GMT offset, _is_ .2916666666...), is there ANY conceivable reason for
> this?
>
> 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.
>
> -EJR
>
> James Howard wrote:
> >
> > On Wed, 29 Aug 2001, E. Joshua Rigler wrote:
> >
> > > Can someone explain the following?
> > >
> > >  octave:240> datenum (1995, 01, 05)
> > >  ans = 728664.291666667
> > >               ^^^^^^^^^
> > >
> > > In particular, why is there a fractional day?  I included no hours,
> >
> > Without a lot of evidence, I think it is a timezone issue.  Set your
> > timezone to GMT before starting Octave and this should work.  Or, run
> > datenum(1995,1,5,17,0,0) because Colorado is seven hours behind GMT (I am
> > in DC and we are five back).
> >
> > Jamie
>
> -------------------------------------------------------------
> 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
> -------------------------------------------------------------



-------------------------------------------------------------
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]