Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

TIMESTAMP in a datatable with 1 time in mins CR1000X


SebastienLisah Oct 23, 2024 07:07 AM

Hi,
I have a CR1000X.
Is it possible to save the TIMESTAMP in a datatable with 1 days in mins than the real time?
It is for a weather program with daily data.

My weather standard requires the measurement of the maximum daily temperature from 6am to 6am. The data corresponds to the previous day.

Example : 
The Real time is 2024-10-23 6:00:00

DataTable (MTO,True,-1)
        DataInterval (6,24,Hr,0)
        Maximum (1,Temp,FP2,False,False)
EndTable

Begin prog

Scan(60,min,100)

MEASURE....

Calltable MTO

Nextscan
Endprog

The table OUT TIMESTAMP is 2024-10-23 6:00:00
But, i want to write the TIMESTAMP to 2024-10-22 6:00:00

Thank you for your help


JDavis Oct 23, 2024 05:19 PM

You cannot override the TimeStamp column. You could create another column in the data table for the adjusted time.

To calculate the adjusted timestamp, use the SecsSince1990 on Public.TimeStamp and subtract an offset.

 

Public AdjustedTime(2) As Long

DataTable (Test,True,-1 )
  DataInterval (1,10,Sec,10)
  Sample (1,AdjustedTime(1),Nsec)
EndTable
'Main Program
BeginProg
  Scan (1,Sec,0,0)

    AdjustedTime(1) = 	SecsSince1990 (Public.TimeStamp(1,1),1) - 86400
    'AdjustedTime(2) = 0  'Nanoseconds are left zero

    CallTable Test
  NextScan
EndProg

 

Log in or register to post/reply in the forum.