how to get time in dynamic C?

Hi, how can i get the system time and display in dynamic C?

check out the samples in the RTCLOCK folder. They will let you set the time and read the time.

i think the code should look something like this

#include
#include

void main()
{
SYSTEMTIME str_t;
GetSystemTime(&str_t);

printf("Year:%d

Month:%d
Date:%d
Hour:%d
Min:%d
Second:% d
"
,str_t.wYear,str_t.wMonth,str_t.wDay
,str_t.wHour,str_t.wMinute,str_t.wSecond);

}

but dynamic C can’t seem to recognize #include how to use the library functions then?

the code should look something like this

#include
#include

void main()
{
SYSTEMTIME str_t;
GetSystemTime(&str_t);

printf("Year:%d

Month:%d
Date:%d
Hour:%d
Min:%d
Second:% d
"
,str_t.wYear,str_t.wMonth,str_t.wDay
,str_t.wHour,str_t.wMinute,str_t.wSecond);

}

but #include can’t be used and the function stdio is not available either… any ideas?

the code in C shld look something like this

#include
#include

void main()
{
SYSTEMTIME str_t;
GetSystemTime(&str_t);

printf("Year:%d

Month:%d
Date:%d
Hour:%d
Min:%d
Second:% d
"
,str_t.wYear,str_t.wMonth,str_t.wDay
,str_t.wHour,str_t.wMinute,str_t.wSecond);

}

but #include cannot be used and is not availbe either… any ideas?

This isn’t windows, and it’s not ANSI C.


    struct tm    rtc;    // time struct

    tm_rd(&rtc);        // get time in struct tm

You’ll find this function documented in the Dynamic C Function Reference Manual.

ok got it already thanks