[Overview][Procedures and functions][Variables][Index] Reference for unit 'unixutil' (#rtl)

EpochToLocal (deprecated)

Convert epoch time to local time

Declaration

Source position: unixutil.pp line 37

procedure EpochToLocal(

  epoch: LongInt;

  var year: Word;

  var month: Word;

  var day: Word;

  var hour: Word;

  var minute: Word;

  var second: Word

);

Description

Converts the epoch time (=Number of seconds since 00:00:00, January 1, 1970, corrected for your time zone) to local date and time.

This function takes into account the timezone settings of your system.

Errors

None

See also

LocalToEpoch

  

Convert local time to epoch (UNIX) time

Example

Program Example3;

{ Program to demonstrate the EpochToLocal function. }

Uses BaseUnix,Unix,UnixUtil;

Var Year,month,day,hour,minute,seconds : Word;

begin
  EpochToLocal (FPTime,Year,month,day,hour,minute,seconds);
  Writeln ('Current date : ',Day:2,'/',Month:2,'/',Year:4);
  Writeln ('Current time : ',Hour:2,':',minute:2,':',seconds:2);
end.

Documentation generated on: May 14 2021