help-octave
[Top][All Lists]
Advanced

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

problem parsing time out of datetime object


From: AG
Subject: problem parsing time out of datetime object
Date: Fri, 20 Oct 2017 11:18:55 -0700 (MST)

I am trying to parse a datetime string into two pieces, date and time, and
I'm trying to figure out why this code does not work.  According to the docs
it seems that a call to rem on a datetime will give you the time but it
doesn't seem to do that.

dt_num = datenum('2013/05/29 00:00:00','YYYY/DD/MM HH:MM:SS')

 d_num = floor(dt_num)
 t_num = rem(dt_num,1)

datestr(d_num) ## ans = 05-Jan-2013  (RIGHT!)
datestr(t_num)  ## ans = 31-Dec--001 (WRONG)

Much appreciated.
Platform: Win 10, Octave. 4.2.1 



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



reply via email to

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