Difference between revisions of "Extensions.DateTime.GetTimeStamp"

From emotive
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Integer time;
+
IntegerTerm DateTime.GetTimestamp();
time = DateTime.GetTimestamp();
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 12: Line 11:
 
'''GetTimestamp''' shall return a timestamp, expressed in milliseconds elapsed since 1970-01-01 00:00:00 UTC.
 
'''GetTimestamp''' shall return a timestamp, expressed in milliseconds elapsed since 1970-01-01 00:00:00 UTC.
  
{{TermReturnValue| [[Integer]] | This result returns a timestamp in milliseconds.}}
+
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.Integer|Integer]] | This result returns a timestamp in milliseconds.}}
 +
 
 +
== Properties ==
 +
* NONE
  
 
== OTL Examples ==
 
== OTL Examples ==
 
<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
+
/// Local Declarations
Integer timestamp;
+
 
 +
Integer Timestamp;
 
String myCurrentTimeString;
 
String myCurrentTimeString;
  
timestamp = DateTime.GetTimestamp();
+
/// Flow
// returns the String "2014-07-12 16:18:03"
+
 
myCurrentTimeString = DateTime.FormatDate(timestamp, "YYYY-MM-dd HH:mm:ss");
+
Timestamp = DateTime.GetTimestamp();
 +
myCurrentTimeString = DateTime.FormatDate(Timestamp, "YYYY-MM-dd HH:mm:ss");
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== See also ==
 
== See also ==
[[FormatDate]]<br/>
+
[[Extensions.DateTime.FormatDate|FormatDate]]<br/>
[[FormatDuration]]
+
[[Extensions.DateTime.FormatDuration|FormatDuration]]

Latest revision as of 05:43, 1 November 2018

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

IntegerTerm 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.

Properties

  • NONE

OTL Examples

/// Local Declarations

Integer Timestamp;
String myCurrentTimeString;

/// Flow

Timestamp = DateTime.GetTimestamp();
myCurrentTimeString = DateTime.FormatDate(Timestamp, "YYYY-MM-dd HH:mm:ss");

See also

FormatDate
FormatDuration