From: kingwinter <kin...@gm...> - 2010-09-13 14:13:05
|
Thanks very much. It works. KingWinter Rich Mattes-2 wrote: > > The last post in this thread[1] should work. Once you have the datenum, > you > can plug it in to datestr() to make it human readable. For example: > >>> datestr(datenum([1970 1 1 0 0 1248951287.662])) > ans = > 30-Jul-2009 10:54:47 > > If it still looks off, it could be because the time zone offset isn't > factored in. > > Rich > > [1] http://www.mathworks.com/matlabcentral/newsreader/view_thread/163194 > > -----Original Message----- > From: Michael Bienia [mailto:mi...@bi...] > Sent: Friday, September 10, 2010 8:19 AM > To: pla...@li... > Subject: Re: [Playerstage-users] time format of the writelog > > On 2010-09-10 11:57:15 +0100, king winter wrote: > Hi, >> Is there anyone know how to convert the time stamp of time stamp in the > log >> file which is generated by writelog? I try to use matlab's convert > function >> but it looks not right. > > The timestamp is the unix epoch: seconds since 1970-01-01 00:00:00 UTC. > >> here is one line of the log: >> 1248951287.662 16777343 6665 position2d 00 004 001 -00.100 +00.000 +0.000 >> +00.513 +00.425 >> 1248951287.662 is the time stamp. Can anyone help to give a command >> either >> in matlab or c++ to convert it to date and time? > > Something like should do it (tested on Linux): > ,---- > | #include <iostream> > | #include <ctime> > | > | using namespace std; > | > | int main(void) { > | const time_t time = 1248951287; > | cout << ctime(&time); > | return 0; > | } > `---- > This gives "Thu Jul 30 12:54:47 2009" for your timestamp. > See also the manpages for "asctime", "gmtime" and "localtime". > > HTH, > Michael > > ---------------------------------------------------------------------------- > -- > Automate Storage Tiering Simply > Optimize IT performance and efficiency through flexible, powerful, > automated storage tiering capabilities. View this brief to learn how > you can reduce costs and improve performance. > http://p.sf.net/sfu/dell-sfdev2dev > _______________________________________________ > Playerstage-users mailing list > Pla...@li... > https://lists.sourceforge.net/lists/listinfo/playerstage-users > > > ------------------------------------------------------------------------------ > Automate Storage Tiering Simply > Optimize IT performance and efficiency through flexible, powerful, > automated storage tiering capabilities. View this brief to learn how > you can reduce costs and improve performance. > http://p.sf.net/sfu/dell-sfdev2dev > _______________________________________________ > Playerstage-users mailing list > Pla...@li... > https://lists.sourceforge.net/lists/listinfo/playerstage-users > > -- View this message in context: http://old.nabble.com/time-format-of-the-writelog-tp29675637p29698703.html Sent from the playerstage-users mailing list archive at Nabble.com. |