I’m newbie to Linux kernel.
Is there a way to print from within kernel time stamp, which respects timezone and DST, as done in user space (e.g. by localtime(3))?
I suspect TZ and DST live in user space land only and not relevant in context of kernel space, but I’m required to print user friendly message from kernel module.
Thanks
You are correct in that TZ and DST live only in userspace. The kernel never knows what time zone it is. If you really need to do this, you will need to have a userspace helper upload timezone offsets to kernelspace – remember to deal with daylight savings time properly here! Alternately have a userspace tool postprocess kernel messages (which would be in UTC) and convert them to local time.