Logging Variable UTC time

Hi Guys!
Probably a very simple solution to this…

I need to send a timestamp in UTC time on start of item. Thinking %T{} but how to format it?

need the output formatted to “2024-01-18T14:56:14Z”

Thanks

Maybe…

%T{yyyy-mm-ddThh:nn:ssZ} / %T{yyyy-mm-dd hh:nn:ss}

? :thinking:

Delphi Basics : FormatDateTime command

Hi Liam! You are right, but how to convert it from local time (CET) to UTC timestamp? Any idea? This is using the logging module in mAirlist and not via a script.

Oh. Sorry, then I misunderstood the initial post. Unfortunately, I don’t know the way either. If it is possible at all.

Because in this format, I think mAirList only sends the time that mAirList was set to.

It would be interesting to know whether the internal clock is taken into account here :thinking:

Hi Thomas,

try the following script:

procedure OnPlayerStart(PlaylistIndex: integer; PlayerIndex: integer; Item: IPlaylistItem);
var
  dt: TDateTime;
begin
  dt := Instance.FakeNow - 3600.0/86400.0;
  SetRuntimeData('Zulu', FormatDateTime('yyyy-mm-dd', dt) + 'T' 
    + FormatDateTime('hh:nn:ss', dt) + 'Z');
end;

begin
end.

Log %R{Zulu}. In case of DST change quotient to 7200.0/86400.0.

 
Happy holidays, TSD

3 Likes