Sorry. I forgot those macros are only for build times, not current. Other than do_gettimeofday(), I know nothing of other ways.
On Jan 19, 11:25 am, "Dwi Sasongko S" <ruck...@gmail.com> wrote: > 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: android-kernel@googlegroups.com > To: Android Linux Kernel Development > ReplyTo: android-kernel@googlegroups.com > 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 <gre...@gmail.com> wrote: > > On Mon, Jan 18, 2010 at 6:34 PM, Chew Esmero <chew.esm...@gmail.com> 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 <perumal...@gmail.com> 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: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel