Hi,
i am using LPC 2132 and LPC 2134 as microcontrollers. Is there a way to print current time/system time on console logs.
And the first question you got was "Does your system maintain a "current time/system time" ?"
That is a relevant question.
You can't pick up a time using any CRTL functions, unless you do have a time maintained somewhere. Do you have a battery on the board, and drive the RTC (Real Time Clock) device in the processor? If you do, then you need code to set the initial time in the RTC. Similar code would then also be able to retrieve the time from the RTC.
Or do you have an external RTC using I2C? Same there - you need code to set the time of the RTC and similar code may then be able to retrieve the time too.
Keil can't supply you with CRTL functions to get the time since there are no generally available clock in embedded devices.
If you look at the manuals for the CRTL, they mention specifically functions that you need to write yourself, if you want to incorporate clock functionality in the CRTL.
The C standard library includes code that can convert between an integer in Unix epoch into individual fields year/month/day-of-month/hour/min/sec or reverse. But you need a place to store that ticking secounds counter that time() is intended to return.