Home » Community » Newbie corner » Usage of Date and Time
Usage of Date and Time [message #27417] |
Fri, 16 July 2010 13:44 |
281264
Messages: 270 Registered: June 2010 Location: Spain
|
Experienced Member |
|
|
Hi,
I World like to know how to use Date and Time; for instance, how to show date and time in the appropriate Ctrl (shall we say a static label)?; or how to write current date and time in a file?
I would appreciate some help.
Thanks. Cheers,
Javier
|
|
|
Re: Usage of Date and Time [message #27420 is a reply to message #27417] |
Fri, 16 July 2010 15:50 |
|
281264 wrote on Fri, 16 July 2010 13:44 | Hi,
I World like to know how to use Date and Time; for instance, how to show date and time in the appropriate Ctrl (shall we say a static label)?; or how to write current date and time in a file?
I would appreciate some help.
Thanks. Cheers,
Javier
|
Hi Javier,
To get curent time and date, there are functions GetSysTime();
GetUtcTime();
GetSysDate();
The simplest way to show it is just sending it to the Ctrl as any other Value:lineedit << GetSysTime();
// OR in case of label
label.SetLabel(AsString(GetSysTime()));
If you want to use other then default formatting, there are (at least) two ways to format it:FormatDate();
FormatTime();
Format(); // uses formatting string defined globaly by SetDateFormat();
To get time or date from String, there is
Have a look into the manual: Date formating and scanning, Date and Time and aslo Core Values tutorial (section 4).
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Wed Apr 24 14:11:02 CEST 2024
Total time taken to generate the page: 0.03080 seconds
|