How to setup parser for datatime containing millisecond info.?

Started by ccdr, April 26, 2017, 08:17:35 AM

Previous topic - Next topic

ccdr

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.

Arthur Grasin

If you like my work, please take a few seconds and add feedback about our site or our software [here]

ccdr

Quote from: Arthur Grasin on April 26, 2017, 10:47:05 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

Arthur Grasin

Please, try the following format:
YYYY"-"MM"-"DD HH":"NN":"SS":"ZZZ
If you like my work, please take a few seconds and add feedback about our site or our software [here]

ccdr

Unfortunately, this does not work.
TIME[7] does not contain any ZZZ info. in it.

Arthur Grasin

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.
If you like my work, please take a few seconds and add feedback about our site or our software [here]

ccdr

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.

Arthur Grasin

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.
If you like my work, please take a few seconds and add feedback about our site or our software [here]