Historian t_stamp format

I was wondering how to change the t_stamp data to be in a datetime format? It is currently only a long number which is difficult to use.

It is converted to java.util.Date for you by the tag historian's query functions. It is stored as a long integer (UTC epoch milliseconds) to work around some database brands' poor support for reliable UTC-based timestamp storage.

Use the tag historian's query functions. If you must use direct SQL for some reason, you will need to convert these yourself, taking care to get the timezones right.

There is also a knowledge base article here:


I think I know the answer but just to confirm. The UTC epoch milliseconds format does not suffer from the Year 2038 issue correct?

It could, this problem exists when a system stores this value in a 32-bit signed integer. If it's stored as 64-bit then it's not a problem.

Just for posterity I checked in the Maria DB we are using and it is defined as a bigint(20). This is clearly much larger than a 32-bit signed integer.