SQLite datalogger timestamp format

I’m using the SQLite datalogger to store measure and event values in two different configurations. Now I wanted to use Node.js to read the data from the created databases, which works fine. But now my question is how can i interpret the value in the “Timestamp” column as a readable date time? e.g. a value in this column is 5249124847214548914 which is obviously no unix timestamp, because when converting this value to a readable date time it results in "27.12.166338146642 - 23:41:54" My current setting in the datalogger configuration for Timestamp format is “RAW”, but I also used ISO 8601 format, which ended in a similar result.

Hello, There was a problem with PLCnext Engineer 2020.6, which meant that the selection of ISO 8601 format was effectively ignored: https://www.plcnext-community.net/en/discussions-2-offcanvas/native-datalogger.html#reply-6245 This should be fixed in PLCnext Engineer 2021.0. The RAW time format is described in the Info Center:

The implementation and internal representation complies to the Microsoft® .NET DateTime class, see the documentation of DateTime Struct on docs.microsoft.com.

More information is given in that other forum thread:

The Datalogger uses the ToBinary method to encode the date/time and “kind” data. If you are using C# or VB.NET to read the TimeStamp field, you can use the FromBinary method. Otherwise you can remove the two leading bits, and the remaining data represents the ticks (in 100s of nanoseconds) since 01.01.0001.

… and a conversion example is given: https://www.plcnext-community.net/en/discussions-2-offcanvas/native-datalogger.html#reply-6098 Hope this helps. ~ Martin.

Hi Martin, thanks for the reply. I tried to update the existing project to PLC Next Engineer 2021.0 but unfortunately i get two error messages after the conversion. One of the error messages mentiones the DataLogger, but i deleted my existing configuration before the conversion. See error messages in attachment.

Unbenannt.PNG

OK, we will need to get more information about your project. Is it OK if we contact you at the email address that you used to register on this forum?

sure, no problem

This has been answered by email, but for others - the datalogger issue is also discussed here: https://www.plcnext-community.net/en/discussions-2-offcanvas/datalogger-problem.html