help-octave
[Top][All Lists]
Advanced

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

Re: octave datevec() v/s Excel/LibreOffice


From: jmb
Subject: Re: octave datevec() v/s Excel/LibreOffice
Date: Mon, 29 Sep 2014 11:47:11 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1

On 09/29/2014 11:07 AM, Mike Miller wrote:
> On Mon, Sep 29, 2014 at 10:45:41 -0400, jmb wrote:
>> Hello,
>> I am finding a difference between how octave interprets a serial date to
>> a date string versus what LibreOffice/MS-Excel show:
>>
>> A. LibreOffice / MS-Excel:
>>         '41908.402198066' -> 09/26/2014 09:39:10  (which is correct)
>> B. Octave:
>>         datevec(41908.402198066)
>>         ans =
>>         114.0000     9.0000    27.0000     9.0000    39.0000     9.9129
>> (Tested in Octave 3.2.4 & 3.8.1 running in 64bit Ubuntu 12.04+)
>> I assume that 114 means 2014, but why do I get 27th instead of the
>> correct 26Sep2014?  What am I doing wrong or missing?  Any help would be
>> appreciated.  Thank you.
> Hi JMB, you'll probably find the m2xdate function helpful:
>   http://octave.sourceforge.net/financial/function/m2xdate.html
> HTH,
>
Hello Mike,

Thanks for your suggestion.  I installed io & financial
    pkg install -forge -verbose io financial
    pkg load io financial
    serial = 41908.402198066;
    m2xdate(serial);
    warning: Negative date found, this will not work within MS excel
    ans = -6.2505e+05

I tried variants of m2xdate(serial, [1/0], [""/"ExcelBug"]); all
resulting in the same error/warning.
I am puzzled ... !  Any other suggestions?  Thank you.

Regards, JMB





reply via email to

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