Difference between revisions of "Extensions.DateTime.GetTimeStamp"

From emotive
Jump to navigation Jump to search
Line 3: Line 3:
 
{{ClassificationActivity | GetTimeStamp | Returns a timestamp in milliseconds | [[Term]] | [[DateTime|OTX DateTime Extension]] | - | - | - | Yes}}
 
{{ClassificationActivity | GetTimeStamp | Returns a timestamp in milliseconds | [[Term]] | [[DateTime|OTX DateTime Extension]] | - | - | - | Yes}}
  
== Pseudo-Code Syntax ==
+
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Integer timeStamp = GetTimeStamp();
+
Integer time;
 +
time = DateTime.GetTimestamp();
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 16: Line 17:
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
// Return a string of the current data/time
 
// Return a string of the current data/time
Integer timestamp = GetTime();
+
Integer timestamp;
String myCurrentTimeString = FormatDate(timestamp, "YYYY-MM-dd HH:mm:ss");
+
String myCurrentTimeString;
 +
 
 +
timestamp = GetTime();
 
// returns the String "2014-07-12 16:18:03"
 
// returns the String "2014-07-12 16:18:03"
 +
myCurrentTimeString = FormatDate(timestamp, "YYYY-MM-dd HH:mm:ss");
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 12:24, 2 January 2015

Classification

Name GetTimeStamp
Short Description Returns a timestamp in milliseconds
Class Term
Extension OTX DateTime Extension
Group -
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

Integer time;
time = DateTime.GetTimestamp();

Description

GetTimestamp shall return a timestamp, expressed in milliseconds elapsed since 1970-01-01 00:00:00 UTC.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Integer This result returns a timestamp in milliseconds.

Examples

// Return a string of the current data/time
Integer timestamp;
String myCurrentTimeString;

timestamp = GetTime();
// returns the String "2014-07-12 16:18:03"
myCurrentTimeString = FormatDate(timestamp, "YYYY-MM-dd HH:mm:ss");

See also

FormatDate
FormatDuration