• Not Answered

Epoch (UTC) time used by DeltaV TIME functions

Hi all,

DeltaV books-online indicates that, the TIME function "Returns the current Local or UTC time as an Epoch Time value (the number of seconds since midnight, January 1, 1972).

I recently tried to read the time from another system in Epoch format, to show it on operator screen, & found difference of two years shown on screen. I used standard TIME_TO_STR function.
I used math functions to substract 2 years worth of seconds from the input to get correct time on screen.

Upon search on internet, I found out that:

Epoch Time: Also known as Unix time or Posix time (Used by cTime or Time_t programming functions)  indicates time in seconds since 00:00:00 UTC on 1 January 1970.

Clinks Time: Also known as Acnet time (Used by Clinklib.cpp functions) indicates time in seconds since 00:00:00 CST on 1 January 1972.

Now the questions are:

1. If DeltaV uses Epoch time, how come it counts from 1972 instead of 1970?

2. Clinks time used CST (Central Standard TIME), so it does not consider daylight time savings like CDT (Central Daylight TIME). (Combination of CST & CDT makes ‘Local Time’). So, will the TIME_TO_STR function consider daylight time shifts, OR the indication on screen will go wrong with daylight time shift next month?

3. Is there a better way to handle this scenario? Has anybody faced this issue before somewhere else?

Thanks in advance for your responses!
Best Regards,

Amod Bobade
Emerson Process Management | Process Systems & Solutions
Dokkvegen 8 | Porsgrunn 3920 | Norway.
E-Mail: Amod.Bobade@Emerson.com

3 Replies

  • If you are just trying to show on a DeltaV Operate screen, you can use the data source System.CurrentTime or System.CurrentDate which are available from the Insert menu item in configure mode.

    If you need the time and date in the controller then you should use the TIME_TO_STR function which I have used many times and haven't had any issues with. Here is the logic for Hrs, Mins and Secs.

    '^/HH.CV' := TIME_TO_STR("%h", TIME('$time_format:Local'));

    '^/MM.CV' := TIME_TO_STR("%i", TIME('$time_format:Local'));

    '^/SS.CV' := TIME_TO_STR("%s", TIME('$time_format:Local'));

    Regards,

    Matt

  • In reply to Matt Stoner:

    Thanks Matt!

    I am using the same TIME_TO_STR function, but not the "TIME('$time_format:Local')" part, as I have to display the time received over modbus TCP/IP from another system as 32 bit Analog value.

    Their system says they use EPOCH format UTC time, same as we do, but our standards seem different than theirs... :-)

  • In reply to amodbobade:

    Change the '$time_format:Local' to '$time_format:UTC' (I assume you are).

    Seems like you might need to do some logic to get the EPOCH dates together if they are different.

    Good Luck