Difference between revisions of "Now"

From SDU
Jump to: navigation, search
m
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
[[Category:Customizations]]
 +
[[Category:r6]]
 +
[[Category:r11]]
 +
[[Category:Spell Code]]
 
{{Global Header}}
 
{{Global Header}}
 
+
{{Global Announcement}}
 
== Overview ==
 
== Overview ==
now()
+
Return current date and time in datetime format. It can be converted to Unix timestamp using cast to int.
 +
 
 +
== Usage ==
 +
<source lang="javascript">
 +
date now()
 +
</source>
 +
 
 +
== Results ==
 +
Current date and time in datetime format.
 +
 
 +
== Examples ==
 +
<source lang="javascript">
 +
chg.modified_date = now();
 +
alg.time_spent = now() - time_stamp;
  
returns a date and time string, which can be converted to a date and time var
+
if ((int)now() > (int)need_by-600) {
 +
set_return_data(TRUE);
 +
} else {
 +
set_return_data(FALSE);
 +
}
 +
</source>

Latest revision as of 13:11, 21 August 2009

To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Overview

Return current date and time in datetime format. It can be converted to Unix timestamp using cast to int.

Usage

<source lang="javascript"> date now() </source>

Results

Current date and time in datetime format.

Examples

<source lang="javascript"> chg.modified_date = now(); alg.time_spent = now() - time_stamp;

if ((int)now() > (int)need_by-600) { set_return_data(TRUE); } else { set_return_data(FALSE); } </source>