help-octave
[Top][All Lists]
Advanced

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

Re: problem parsing time out of datetime object


From: AG
Subject: Re: problem parsing time out of datetime object
Date: Sun, 22 Oct 2017 11:27:34 -0700 (MST)

Thanks to everyone for helping me with this. Bottom line: I figured out my
problem. Not sure if it is a bug, documentation, or user error though.

It all stems from me trying to just get a time ONLY object so I can compare
times (e.g. 9:30 vs 16:00). Forget the funky datestr issue for a sec. 
I wanted to create a time ONLY datenum. Flooring the the datenum gets me a
datevec that makes sense to me - no real date but time is good. You can see
the datevec has a neg year.
I had assumed that creating a datenum using a time string would produce a
similar datevec but it puts in a real date...that was my problem.

datevec(rem(datenum('00:00:00',13),1))
ans =

   -1   12   31    0    0    0

VERSUS
 
datevec('00:00:00')
ans =

   2017      1      1      0      0      0

datevec(datenum('00:00:00',13))
ans =

   2017      1      1      0      0      0






--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

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