Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8475975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:02:52+00:00 2026-06-10T18:02:52+00:00

Linux kernel provides time_to_tm() (see here ): /** * time_to_tm – converts the calendar

  • 0

Linux kernel provides time_to_tm() (see here):

/**
 * time_to_tm - converts the calendar time to local broken-down time
 *
 * @totalsecs   the number of seconds elapsed since 00:00:00 on January 1, 1970,
 *              Coordinated Universal Time (UTC).
 * @offset      offset seconds adding to totalsecs.
 * @result      pointer to struct tm variable to receive broken-down time
 */
void time_to_tm(time_t totalsecs, int offset, struct tm *result)

According to description, tm will be local broken-down time.
Thus I understand tm will respect my local time zone and DST.
If this correct, I don’t see it in the code.

Maybe argument offset should be used to “provide” local time zone and DST?

UPDATE

Following this question, thus using sys_tz in conjunction with time_to_tm() we can get “true” local time?
AFAIK, localtime notation belongs to userland. For example DST is defined in specially compiled configuration files per time zone.

I’m confused. What is the meaning of sys_tz in kernel than?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:02:53+00:00Added an answer on June 10, 2026 at 6:02 pm

    The kernel doesn’t know or care about timezones or DST, everything it does is in terms of seconds since the epoch. Timezones and DST are handled by libraries in user mode, which check your environment variables and can scan the timezone files.

    This function is not callable by the end user — there’s no system call interface to it. It’s just used internally within the kernel. If you look in the cross-reference (http://lxr.free-electrons.com/ident?v=2.6.33;i=time_to_tm), the only place it’s currently called from is the FAT filesystem driver. It is indeed used to adjust for timezone; it was done to support the tzoff mount option.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

linux kernel is really worth to spend a lot of time of read, but
I'm writing a linux kernel module that provides a (virtual) block device (so no
I'm studying about Linux kernel and I have a problem. I see many Linux
in Linux kernel source code, I find below code: h++; pending >>= 1; It
Is Linux Kernel scheduler a part of init process? My understanding is that it
Before Linux kernel 2.6, super_operations (include/linux/fs.h) have both read_inode and write_inode functions. But newer
The linux kernel I compile only prints message like: CC ..... LD [M] ....
Is it possible on Linux kernel 3.0+ to increase thread's quantum from user-mode? How?
Compiling a kernel module on 32-Bit Linux kernel results in __udivdi3 [mymodule.ko] undefined! __umoddi3
I'm developing a Linux kernel module outside of the Linux source tree (in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.