[Top] [Prev] [Next]

daytime: text, filet, gmt, local, now, time, tm2epoch - time conversions

include "daytime.m";
daytime:= load Daytime Daytime->PATH;
Tm: adt
{
  sec:     int;
  min:     int;
  hour:    int;
  mday:    int;
  mon:     int;
  year:    int;
  wday:    int;
  yday:    int;
  zone:    string;
  tzoff:   int;
};
text:     fn(tm: ref Tm)    : string;
filet:    fn(now, file: int): string;
gmt:      fn(tim: int)      : ref Tm;
local:    fn(tim: int)      : ref Tm;
now:      fn()              : int;
time:     fn()              : string;
tm2epoch: fn(tm: ref Tm)    : int;

Description

These routines perform time conversions relative to the epoch 00:00:00 GMT, Jan. 1, 1970.
text (tm)

The text function converts a time adt referenced by tm from local or GMT time to a string in the format: Tue Aug 16 17:03:52 CDT 1977

filet (now, file)

The filet function converts the file time file from seconds since the epoch to local time as a string in the format: Aug 16 17:03 if the file is less than 6 months old or Aug 16 1977 if the file is older than 6 months.

gmt (tim)

The gmt function converts seconds since the epoch contained in tim to a time adt in Greenwich Mean Time (GMT).

local (tim)

The local function converts seconds since the epoch contained in tim to a time adt in local time.

now ( )

The now function returns the time in seconds since the epoch. This functions works by reading file /dev/time to get the time in microseconds since the epoch.

time ( )

The time function returns the local time as a string in the format: Tue Aug 16 17:03:52 CDT 1977

tm2epoch (tm)

The tm2epoch function converts a time adt referenced by tm from local or GMT time to seconds since the epoch.

Caveat

The sign bit of a Limbo integer holding a time will turn on 68 years from the epoch.

"GMT" is used rather than "UTC" as in other operating systems. There is no serious treatment of leap seconds, instead the epoch is implicitly shifted. Existing practice also dictate the following conventions:
year=96

means 1996

mday=1

means first day of the month

wday=0

means Sunday

mon=0

means January



[Top] [Prev] [Next]

infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights reserved.