Difference between revisions of "Extensions.DateTime.FormatDate"

From emotive
Jump to navigation Jump to search
Line 2: Line 2:
 
== Classification ==
 
== Classification ==
 
{{ClassificationActivity | FormatDate | Returns a formatted time representation of a timestamp. | [[Term]] | [[DateTime|OTX DateTime Extension]] | - | [[OutOfBoundsException]] | - | Yes}}
 
{{ClassificationActivity | FormatDate | Returns a formatted time representation of a timestamp. | [[Term]] | [[DateTime|OTX DateTime Extension]] | - | [[OutOfBoundsException]] | - | Yes}}
 +
 +
== Pseudo-Code Syntax ==
 +
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 +
String time = FormatDate(timeStamp , <<pattern>>);
 +
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
Line 21: Line 26:
 
|}
 
|}
  
== Pseudo-Code Syntax ==
+
{{TermReturnValue| [[String]] | Date in the form according to ISO8601 or as specified.}}
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
String time = FormatDate(timeStamp , <<pattern>>);
 
</syntaxhighlight>
 
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| Time | [[String]] | [[Variable]] | - | [0..1] | Date in the form according to ISO8601 or as specified.}}
+
{{TableRowPropertie1| Timestamp | [[Integer]] | [[Term]] | - | [0..1] | This property specifies a date as a time stamp, which is interpreted as the number of milliseconds elapsed since January 1 1970 00:00:00 UTC.}}
{{TableRowPropertie2| Timestamp | [[Integer]] | [[Term]] | - | [0..1] | This property specifies a date as a time stamp, which is interpreted as the number of milliseconds elapsed since January 1 1970 00:00:00 UTC.}}
+
{{TableRowPropertie2| Pattern | [[String]] | [[Term]] | - | [0..1] | This feature can represent time in the desired format.}}
{{TableRowPropertie1 | Pattern | [[String]] | [[Term]] | - | [0..1] | This feature can represent time in the desired format.}}
 
 
|}
 
|}
  

Revision as of 06:45, 17 July 2014

Classification

Name FormatDate
Short Description Returns a formatted time representation of a timestamp.
Class Term
Extension OTX DateTime Extension
Group -
Exceptions OutOfBoundsException
Checker Rules -
Standard Compliant Yes

Pseudo-Code Syntax

String time = FormatDate(timeStamp , <<pattern>>);

Description

Date format is a term which converts a timestamp in a date format and returns as a string. If there is no formatting specified, is the time to ISO 8601:2004 in the following format:

YYYY-MM-DDThh:mm:ss[.fff]+hh:mm
(The symbols "-", ".", ":", ",", "+" And "T" are delimiters)

The following table gives an overview of the decoding of the individual format icons.

Modules of the ISO 8601 time format
YYYY MM DD hh mm ss fff hh mm
Year Month Day Hour Minute Second Milisecond Hour (difference from GMT) Minute (difference from GMT)

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
String Date in the form according to ISO8601 or as specified.

Properties

Name Data Type Class Default Cardinality Description
Timestamp Integer Term - [0..1] This property specifies a date as a time stamp, which is interpreted as the number of milliseconds elapsed since January 1 1970 00:00:00 UTC.
Pattern String Term - [0..1] This feature can represent time in the desired format.

Examples

2008-02-01T09: 00:22 +05:00 9:00:22 clock on 1 February 2008, in a time zone that is five hours ahead of UTC, for example, in the specified time zone in Pakistan.

2009-01-01T12: 00:00 +01:00 12:00:00 clock on 1 January 2009 in Germany, Liechtenstein, Austria and Switzerland

See also

GetTimeStamp
FormatDuration