It is a common feature in an application to require the current date time to be displayed in a text field or something similar.
This can be done easily in PalmOS in two steps:
The code is given below:-
UInt32 iTime = TimGetSeconds ();
TimSecondsToDateTime (iTime ,dateTimeP);
TimGetSeconds returns the current date and time of the device in seconds since 12:00 A.M. on January 1, 1904. TimSecondsToDateTime converts the date specified as the number of seconds since January 1,1904 to a DateTimeType structure.