Hi,

Why do you want to do this?

I mean, do you have something in the kernel that need the current datetime 
value?

If only you have RTC device and also the driver with sufficient user space API, 
it's possible to get current datetime by building a user space application, but 
not directly in the kernel.

Cheers,
DWI
------Original Message------
From: perumal316
Sender: [email protected]
To: Android Linux Kernel Development
ReplyTo: [email protected]
Subject: [android-kernel] Re: Date&Time in LKM
Sent: Jan 19, 2010 10:11


Oh Yah, I just realised, it is displaying the date and time the code
is built. Is there any way to get the current date and time?

Thanks In Advance,
Perumal

On Jan 19, 10:54 am, Greg KH <[email protected]> wrote:
> On Mon, Jan 18, 2010 at 6:34 PM, Chew Esmero <[email protected]> wrote:
> > you can use the__DATE__ &__TIME__ macro.
>
> That's only the date and time the code is built, not the current one.
>
> > On Jan 19, 10:23 am, perumal316 <[email protected]> wrote:
> >> Hi,
>
> >> Currently I am writing a loadable kernel module. I want to printk the
> >> current date and time.
>
> Why do you want to do this?  Every printk is stamped with the current
> time offset from boot.
>
> In the end, no, you really can't do this well, think of all of the
> timezone issues...
>
> good luck,
>
> greg k-h



Dwi Sasongko S

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-kernel

Reply via email to