[Top][All Lists]

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

Re: datenum

From: Henry F. Mollet
Subject: Re: datenum
Date: Fri, 10 Dec 2004 09:58:32 -0800
User-agent: Microsoft-Entourage/

GNU Octave, version 2.1.46 (powerpc-apple-darwin6.6).
octave:75> datenum(2000,1,1)
ans = 730486

I thought I did not have octave-forge installed but I appear to use what I
have on the desktop, at least "help datenum" triggers a file from that
octave:76> help datenum
datenum is the user-defined function from the file

 - Function File:  datenum(Y, M, D [, h , m [, s]])
 - Function File:  datenum('date' [, P])
     Returns the specified local time as a number of days since Jan 1,
     0000.  By this reckoning, Jan 1, 1970 is day number 719529.  The
     fractional portion, corresponds to the portion of the specified

     Note: 32-bit architectures only handle times between Dec 14, 1901
     and Jan 19, 2038, with special handling for 0000-01-01.  datenum
     returns -1 in case of a range error.

     See also: date,clock,now,datestr,datevec,calendar,weekday.


on 12/10/04 3:35 AM, Carine Simon at address@hidden wrote:

> Hi,
> I am using the function datenum written by Paul Kienzle (Copyright 2000)
> but I've got some trouble with it.
> Indeed, when I type datenum(2000,1,1), I get 730485 whereas with Matlab,
> I get 730486.
> More important, in the application I am using, I've got the following
> lines:
> da=clock;
> DayOfYear=datenum(0,da(2),da(3));
> In Matlab as in Octave, the first line does work as it gives: da(2) =
> 12, da(3)=10. 
> Now, if as expected, DateOfYear=345 with Matlab, I get DateOfYear=-1
> with Octave.
> So, would you know where it comes from?
> Thanks,
> Carine.

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

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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