0

I wrote a driver program which will interact with RTC and gives the time.

program is:

    outb(GET_HR, CMD_REG);
    hrs = inb(STAT_REG);

    outb(GET_MIN, CMD_REG);
    min = inb(STAT_REG);

    pr_info("time: hrs:min\n", hrs, min);

Its working, but giving in format of GMT. I want my local time(GMT+5.30). I explicitly added 5:30 in the program. some times its not giving correct time. Is there any implicit function to get local time?

Nizam
  • 5,698
  • 9
  • 45
  • 57
gangadhars
  • 2,584
  • 7
  • 41
  • 68

1 Answers1

0

it is not task of the kernel to do time conversions. You should always work with UTC times in kernel and translate them in userspace to localtime.

ensc
  • 6,704
  • 14
  • 22