Date calculation Igor vs Apple
sjr51
Can anyone explain what is going on? The difference is very small and doesn't really matter for what I'm doing, but I'm just wondering what can cause this. Please feel free to tell me if there is a more efficient way to do the calculation :)
Thanks!
Function DateRead()
Wave /T Play_Date_UTC
Variable nTracks=numpnts(Play_Date_UTC)
Make/O /N=(nTracks) testdate2
String olddate
String expr="([[:digit:]]+)\-([[:digit:]]+)\-([[:digit:]]+)T([[:digit:]]+)\:([[:digit:]]+)\:([[:digit:]]+)Z"
String yr,mh,dy,hh,mm,ss
Variable i
For(i=0; i<nTracks; i+=1)
olddate=Play_Date_UTC[i]
SplitString /E=(expr) olddate, yr,mh,dy,hh,mm,ss
testdate2[i]=date2secs(str2num(yr),str2num(mh),str2num(dy))+(3600*str2num(hh))+(60*str2num(mm))+str2num(ss)
EndFor
End
Wave /T Play_Date_UTC
Variable nTracks=numpnts(Play_Date_UTC)
Make/O /N=(nTracks) testdate2
String olddate
String expr="([[:digit:]]+)\-([[:digit:]]+)\-([[:digit:]]+)T([[:digit:]]+)\:([[:digit:]]+)\:([[:digit:]]+)Z"
String yr,mh,dy,hh,mm,ss
Variable i
For(i=0; i<nTracks; i+=1)
olddate=Play_Date_UTC[i]
SplitString /E=(expr) olddate, yr,mh,dy,hh,mm,ss
testdate2[i]=date2secs(str2num(yr),str2num(mh),str2num(dy))+(3600*str2num(hh))+(60*str2num(mm))+str2num(ss)
EndFor
End
July 31, 2015 at 07:45 pm - Permalink
July 31, 2015 at 10:35 pm - Permalink
Shouldn't date/time waves be in double precision? ("/D")
In this case this would be a rounding issue....
HJ
August 1, 2015 at 02:17 am - Permalink
August 1, 2015 at 05:53 am - Permalink
August 2, 2015 at 11:42 am - Permalink