From Clomosy Docs
(Created page with " function Now():TclDateTime; The Now function returns the current date and time in the local time zone. '''Example:'''<br> '''var''' today : TclDateTime;<br> '''begin'''<br> today := Now(); // or Now ShowMessage('Today has date = '+DateToStr(today)); ShowMessage('Today has time = '+TimeToStr(today));<br> '''end;''' '''Output:'''<br> Today has date = 28.02.2023 Today has time = 13:08:53") |
No edit summary |
||
| Line 3: | Line 3: | ||
'''Example:'''<br> | '''Example:'''<br> | ||
:'''Base Syntax''' | |||
var | |||
today : TclDateTime; | |||
begin | |||
today := '''Now'''(); // or Now | |||
ShowMessage('Today has date = '+DateToStr(today)); | |||
ShowMessage('Today has time = '+TimeToStr(today)); | |||
end; | |||
:'''TRObject Syntax''' | |||
var | |||
today : TclDateTime; | |||
{ | |||
today = '''Now'''(); // or Now | |||
ShowMessage('Today has date = '+DateToStr(today)); | |||
ShowMessage('Today has time = '+TimeToStr(today)); | |||
} | |||
'''Output:'''<br> | '''Example Output:'''<br> | ||
Today has date = 28.02.2023 | Today has date = 28.02.2023 | ||
Today has time = 13:08:53 | Today has time = 13:08:53 | ||
Revision as of 13:05, 13 February 2024
function Now():TclDateTime;
The Now function returns the current date and time in the local time zone.
Example:
- Base Syntax
var
today : TclDateTime;
begin
today := Now(); // or Now
ShowMessage('Today has date = '+DateToStr(today));
ShowMessage('Today has time = '+TimeToStr(today));
end;
- TRObject Syntax
var
today : TclDateTime;
{
today = Now(); // or Now
ShowMessage('Today has date = '+DateToStr(today));
ShowMessage('Today has time = '+TimeToStr(today));
}
Example Output:
Today has date = 28.02.2023 Today has time = 13:08:53