From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
function Now():TclDateTime;
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
The Now function returns the current date and time in the local time zone.
function Now():TclDateTime;
</div>


'''Example:'''<br>
The Now function returns the current date and time in the local time zone.<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));
 
  }


'''Example Output:'''<br>
<b>Example</b><br>
Today has date = 28.02.2023
<b>TRObject Syntax</b><br>
Today has time = 13:08:53
<pre>
var
  today : TclDateTime;
{
  today = Now(); // or Now
  ShowMessage('Today has date = '+DateToStr(today));
  ShowMessage('Today has time = '+TimeToStr(today));
}
</pre>
<b>Base Syntax</b><br>
<pre>
var
  today : TclDateTime;
begin
  today := Now(); // or Now
  ShowMessage('Today has date = '+DateToStr(today));
  ShowMessage('Today has time = '+TimeToStr(today));
end;
</pre>
 
 
 
<b>Output:</b><br>
<div class="alert alert-success" role="alert" data-bs-theme="light">
Today has date = 28.02.2023
Today has time = 13:08:53
</div>
 
 
<h2> See Also </h2>
* [[System_Library#Date_and_Time_Functions | Date and Time Functions]]

Revision as of 07:38, 8 October 2024

The Now function returns the current date and time in the local time zone.

Example
TRObject Syntax

var
  today : TclDateTime;
{
  today = Now(); // or Now
  ShowMessage('Today has date = '+DateToStr(today));
  ShowMessage('Today has time = '+TimeToStr(today));
}

Base Syntax

var
  today : TclDateTime;
 
begin
  today := Now(); // or Now
  ShowMessage('Today has date = '+DateToStr(today));
  ShowMessage('Today has time = '+TimeToStr(today));
end;


Output:


See Also