[Scilab-users] How to read in date & time ?

philippe rouxph.22 at gmail.com
Tue Nov 7 18:34:49 CET 2017


Le 07/11/2017 à 15:38, Richard llom a écrit :
>
> 
> However what I'm missing is a way to convert the date & time column to a
> date format in scilab. There doesn't seem to be function for this in scilab.
> Is there a recommended way of doing so?

use datenum and datevec , example :

yourline=["01.01.2017"; "06:00";"419,942"]
// D=day, M=month,Y=year
DMY=tokens(yourline(1),".")
execstr(strsplit("DMY","")+"="+DMY)
DT=datenum(y,m,d)
[Ye,Mo,Da,ho,mi,se]=datevec(DT)
// h=hhours, m=minutes, s=secondes
hm=tokens(yourline(2),":")
execstr(strsplit("hM","")+"="+hM)
s=27
DT=datenum(y,m,d,h,M,s)
[Ye,Mo,Da,ho,mi,se]=datevec(DT)


best regards,

Philippe




More information about the users mailing list