How to get current hour (time of day) in linux kernel space

前端 未结 5 704
我在风中等你
我在风中等你 2020-12-14 08:14

I\'m writing a kernel module that checks to see if the time is between two specified hours, and disables input if it is. This has to do with me wanting to make sure I go to

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-14 08:47

    time_to_tm function can be of your help, which returns the structure tm. Timezone available in variable sys_tz, it can help you to set your offset properly to get local time.

提交回复
热议问题