KERNEL_MKTIME
Section: Kernel Reference Guide (9)
Updated: July 5, 1993
Index
Return to Main Contents
NAME
kernel_mktime - convert startup struct mktime into the number of seconds since 00:00:00 January 1, 1970
SYNOPSIS
linux/kernel/mktime.c
long kernel_mktime(struct mktime * time);
DESCRIPTION
This routine is called from time_init(void),
linux/init/main.c. kernel_mktime()
converts struct mktime
(initialized from CMOS) into an encoded long.
Conversion Method
First an array, month[12], is created holding how
many seconds has passed to reach a peculiar month, for a leap year.
Next, it subtracts 70 from the current year, making 1970 the beginning year.
It is math magic after this point, please look yourself. If you know
why it does this, then send email (see nroff source).
RETURN VALUE
Returns the encoded time in a long
FILES
linux/kernel/mktime.c home of routine
NOTES
This routine is call only during startup of the kernel.
Historically, the value (encoded long) counts the number
of seconds since the Epoch, which
occurred at 00:00:00 January 1, 1970 and
is called Coordinated Universal Time (UTC).
In older manuals, this event is
called Greenwich Mean Time (GMT).
WARNINGS
kernel_mktime() doesn't check to see if the year is greater than 1969. Be
sure your CMOS is set correctly. It is customary to set on-board clocks
to GMT and let processes who ask for the time to convert it to local time, if
necessary.
RESTRICTIONS
For kernel use only.
AUTHOR
Linus Torvalds
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- Conversion Method
-
- RETURN VALUE
-
- FILES
-
- NOTES
-
- WARNINGS
-
- RESTRICTIONS
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 12:22:45 GMT, March 22, 2025