blob: 10ae70805295ed20816e7194218c9dfbc2eb1502 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstrad59c3892019-11-28 20:53:39 +01002 #include <time.h>
MG Mud User88f12472016-06-24 23:31:02 +02003
Zesstrad59c3892019-11-28 20:53:39 +01004 int * gmtime(int clock)
5 int * gmtime(int *uclock)
MG Mud User88f12472016-06-24 23:31:02 +02006
Zesstra715ec202025-07-09 22:18:31 +02007DESCRIPTION
8 Interpret the argument clock as number of seconds since Jan,
9 1st, 1970, 0:00, and return the time in UTC in a nice structure.
10 if <clock> is not specified, time() is used as default.
MG Mud User88f12472016-06-24 23:31:02 +020011
Zesstra715ec202025-07-09 22:18:31 +020012 Alternatively, accept an array of two ints: the first is <clock>
13 value as in the first form, the second int is the number of
14 microseconds elapsed in the current second, which is ignored.
MG Mud User88f12472016-06-24 23:31:02 +020015
Zesstra715ec202025-07-09 22:18:31 +020016 The result is an array of integers:
MG Mud User88f12472016-06-24 23:31:02 +020017
Zesstra715ec202025-07-09 22:18:31 +020018 int TM_SEC (0) : Seconds (0..59)
19 int TM_MIN (1) : Minutes (0..59)
20 int TM_HOUR (2) : Hours (0..23)
21 int TM_MDAY (3) : Day of the month (1..31)
22 int TM_MON (4) : Month of the year (0..11)
23 int TM_YEAR (5) : Year (e.g. 2001)
24 int TM_WDAY (6) : Day of the week (Sunday = 0)
25 int TM_YDAY (7) : Day of the year (0..365)
26 int TM_ISDST (8) : TRUE: Daylight saving time
MG Mud User88f12472016-06-24 23:31:02 +020027
MG Mud User88f12472016-06-24 23:31:02 +020028
Zesstra715ec202025-07-09 22:18:31 +020029EXAMPLES
30 printf("Today is %s\n",
31 ({ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
32 "Friday", "Saturday" })[gmtime()[TM_WDAY]]);
33
34HISTORY
35 Introduced in LDMud 3.2.9.
36
37SEE ALSO
Zesstrad59c3892019-11-28 20:53:39 +010038 ctime(E), localtime(E), time(E), utime(E)