AGG Software Forums

Online Help Center => Data loggers and plug-ins => Topic started by: ccdr on April 26, 2017, 11:17:35 AM



Title: How to setup parser for datatime containing millisecond info.?
Post by: ccdr on April 26, 2017, 11:17:35 AM
The DataTime parser in Data logger suite supports YYYY.MM.DD.HH.NN.SS.
However, my data source comes up with extra millisecond information following SS.
How can I parse them altogether?
Thanks.


Title: Re: How to setup parser for datatime containing millisecond info.?
Post by: Arthur Grasin on April 26, 2017, 01:47:05 PM
Hello,

Could you post a real example?


Title: Re: How to setup parser for datatime containing millisecond info.?
Post by: ccdr on April 27, 2017, 07:01:51 AM
Hello,

Could you post a real example?
Like following format. How to properly parse the last three digits into DateTime data type?
2017-04-27 12:01:20:104
2017-04-27 12:01:20:384
2017-04-27 12:01:20:664
2017-04-27 12:01:20:944
2017-04-27 12:01:21:224
2017-04-27 12:01:21:503
2017-04-27 12:01:21:824


Title: Re: How to setup parser for datatime containing millisecond info.?
Post by: Arthur Grasin on April 27, 2017, 07:32:43 AM
Please, try the following format:
YYYY"-"MM"-"DD HH":"NN":"SS":"ZZZ


Title: Re: How to setup parser for datatime containing millisecond info.?
Post by: ccdr on May 03, 2017, 10:59:55 AM
Unfortunately, this does not work.
TIME[7] does not contain any ZZZ info. in it.


Title: Re: How to setup parser for datatime containing millisecond info.?
Post by: Arthur Grasin on May 03, 2017, 12:02:55 PM
The variable will contains milliseconds, but our software does not display it. You may use this data to export ms to a database, for example.


Title: Re: How to setup parser for datatime containing millisecond info.?
Post by: ccdr on May 04, 2017, 09:56:50 AM
No. I've checked the variable does not transfer the ZZZ to the database(postgresql). I was using TEXT datatype to receive this TIME[7] variable.


Title: Re: How to setup parser for datatime containing millisecond info.?
Post by: Arthur Grasin on May 11, 2017, 08:45:20 AM
I'm sorry for my late reply.

I've verified the parser and it can extract millisecond. To convert date and time with millisecond to a string you may use an expression like:

TIME1=FORMATDATETIME('HH:NN:SS.ZZZ', StartTime)

Then insert the new "TIME1" variable to your database.