This function parses the passed time string and returns the pi local time. If the passed string is a relative time, reltime is used as the starting point for calculating the absolute time. The function returns 0 if the time string is valid and -1 if it is invalid. Valid time strings are an absolute format containing some fields of dd-mmm-yy hh:mm:ss, a relative time in +|- n d|h|m|s, an absolute time specified with a word (today, yesterday, sunday, monday,...), an asterisk for the current time, or a combination time using one of the word absolute times and a relative time. See the Data Archive Manual for more information on the time string format.

C format

int32 pitm_parsetime(

char PIPTR * str,

int32 reltime,

int32 PIPTR * timedate);





Invalid time string


str (passed)

Time string (null terminated)

reltime (passed)

pi time stamp used as the basis for relative times. If str is a relative time, the return time is relative to reltime.

timedate (returned)

Resulting time stamp

Usage Notes

This function when connected to a PI3 server node will generate a timestamp adjusted by 1 hour if the time string is in another DST setting. Therefore, if connection to a PI3 node fails and the time daylight savings settings of the time string differ from the current time, the pitm_parsetime call produces results off by 1 hour.

Enabling Operational Intelligence