Page 1 of 1

Get current system time

Posted: Mon Sep 15, 2014 9:33 am
by Pask
I need to get current system time. Is there some function that can help me? i have read about chTimeNow() but it restart from zero. Someone can give me a solution. pls

Re: Get current system time

Posted: Mon Sep 15, 2014 9:38 am
by Giovanni
Hi,

The RTC driver, see examples.

Giovanni

Re: Get current system time

Posted: Mon Sep 15, 2014 10:05 am
by Pask
i found this example code

Code: Select all

rtcGetTimeTm(&RTCD1, &timp);
chprintf(chp, "%s%s",asctime(&timp)," - formatted time string\r\n");


asctime what is? i don't find information

Re: Get current system time

Posted: Mon Sep 15, 2014 10:07 am
by Giovanni

Re: Get current system time

Posted: Mon Sep 15, 2014 10:21 am
by Pask
ah ok ;-)
i need to get system time in system tick and convert it to us or ms.