Provided by standard library.
The function block run-time clock returns, starting at a given time, the current date and time.

RTC(EN, PDT, Q, CDT) means:
EN and PDT are input variables type TIME. Q and CDT are output variables type BOOL respectively DATE_AND_TIME. When EN is FALSE, the output variables Q und CDT are FALSE respectively DT#1970-01-01-00:00:00.
As soon as EN becomes TRUE, the time of PDT is set, is counted up in seconds and returned in CDT as long as EN is TRUE (see example in the picture above). As soon as EN is reset to FALSE, CDT is reset to the initial value DT#1970-01-01-00:00:00. Please note that the time in PDT is only set by a rising edge.