Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Usage of Date and Time
Usage of Date and Time [message #27417] Fri, 16 July 2010 13:44 Go to next message
281264 is currently offline  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 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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
StrToDate();


Have a look into the manual: Date formating and scanning, Date and Time and aslo Core Values tutorial (section 4).

Best regards,
Honza
Previous Topic: Help needed.
Next Topic: ToolBar mobility.
Goto Forum:
  


Current Time: Wed Apr 24 14:11:02 CEST 2024

Total time taken to generate the page: 0.03080 seconds