AGG Software Forums
November 23, 2024, 05:46:07 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome on our forum!
 
   Home   Help Search Login Register  

Pages: [1]
  Print  
Author Topic: How to setup parser for datatime containing millisecond info.?  (Read 28325 times)
ccdr
Jr. Member
**

Karma: +0/-0
Posts: 71


View Profile
« 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.
Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
*****

Karma: +0/-0
Posts: 806



View Profile WWW
« Reply #1 on: April 26, 2017, 01:47:05 PM »

Hello,

Could you post a real example?
Logged
ccdr
Jr. Member
**

Karma: +0/-0
Posts: 71


View Profile
« Reply #2 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
« Last Edit: April 27, 2017, 07:04:40 AM by ccdr » Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
*****

Karma: +0/-0
Posts: 806



View Profile WWW
« Reply #3 on: April 27, 2017, 07:32:43 AM »

Please, try the following format:
YYYY"-"MM"-"DD HH":"NN":"SS":"ZZZ
Logged
ccdr
Jr. Member
**

Karma: +0/-0
Posts: 71


View Profile
« Reply #4 on: May 03, 2017, 10:59:55 AM »

Unfortunately, this does not work.
TIME[7] does not contain any ZZZ info. in it.
Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
*****

Karma: +0/-0
Posts: 806



View Profile WWW
« Reply #5 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.
Logged
ccdr
Jr. Member
**

Karma: +0/-0
Posts: 71


View Profile
« Reply #6 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.
Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
*****

Karma: +0/-0
Posts: 806



View Profile WWW
« Reply #7 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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines