Use this function to convert a date from one format to a new format.
Date2Date (Date, Format, NewFormat)
Parameter |
Description |
Date |
Enter a date string. The system assumes your entry to be in the format specified in the Format parameter. The default is the current date. |
Format |
Enter a date format string that describes the contents of the Date parameter. The default is date format 1 (MM/DD/YY). |
NewFormat |
Enter the date format you want to convert to. The default is date format 1. |
This function converts a date string from one format to another. The new value is formatted according to the NewFormat parameter.
Here are some examples:
(Assume the current date is 07/01/09 and the variable field called, arc_date, contains the hexadecimal value, BC6792D0)
Function |
Result |
Explanation |
Return(Date2Date( )) |
07/01/2009 |
No parameters entered—defaults to current date in date format 1. |
Return(Date2Date("02/01/09", "1", "44")) |
February 1, 2009 |
Changes the given date (02/01/09) from date format "1" to date format "4", with a four-digit year. |
Return(Date2Date("09/138", "G")) |
05/18/09 |
Changes the given date (09/138) from date format G to the default date format 1. |
Return( Date2Date ( , , "X" ) ); |
BB273650 |
Returns the current date in a eight character hexadecimal representation. |
Return( Date2Date ( @ ("arc date"), "X", "4" ) ); |
February 29, 2008 |
Converts the hexadecimal date to month name DD, YYYY without leading zeros. |
© Copyright 2014, Oracle and/or its affiliates. All rights reserved. Legal notices.