DateTimeFormat (Magic xpi 4.13)
Constructs an XML DateTime value or a JDE Julian Date value from an input date, time, and time zone.
Syntax:
|
DateTimeFormat(Date date, Time time, Alpha timezone, Numeric format)
|
Parameters:
|
date: A date variable (or a hard-coded date, such as '05/06/2008'DATE, or an expression that evaluates to a date).
time: A time variable (or a hard-coded time, such as '16:10:14'TIME, or an expression that evaluates to a time).
timezone: Time zone relative to GMT.
|
|
format (numeric):
|
1. YYYY-MM-DDThh:mm:ssTZD (XML DateTime format).
|
|
|
2. CYYDDD (JDE Julian format), where C is the century (0=1900 and 1=2000), YY is the year and DDD the day of the year.
|
Returns:
|
DateTime string in required format.
|
Examples:
|
XML format:
|
DateTimeFormat('29/04/2008'Date, '10:45:30'Time, '+05:30',1) returns 2008-04-29T10:45:30+5:30.
|
|
JDE Julian format:
|
DateTimeFormat('22/03/2011'Date, '','',2) returns 111081.
|
See also:
|
How Do I Calculate an XML DateTime Format?, How Do I Calculate a Julian Date?, Century
|