help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



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

EpochToLocal

Convert epoch time to local time

Declaration

Source position: unixutil.pp line 40

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 timzeone 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 Unix,UnixUtil;

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

begin
  EpochToLocal (GetEpochTime,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.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505