Article Details
Id:12211
Product:finPOWER Connect
Type:FIX
Version:2.02.00
Opened:03/09/2014
Closed:03/09/2014
Released:29/09/2014
Job: J013949

DateUtilities.DayMonthYearOrderFromFormatString function; some format strings incorrectly parsed

The Business Layer function DateUtilities.DayMonthYearOrderFromFormatString takes a date format string and returns either "DMY", "MDY" or "YMD".

The date format string passed in can either be:

1. "DMY" 2. "MDY" 3. "YMD" 4. A correctly formatted date string. See User-Defined Date/Time Formats (Format Function)5. An all upper case string including D, M and Y.

Option 4 requires you send Days using lower case "d", Months as upper case "M" and Years as lower case "y" - a lower case "m" indicates minutes and is ignored, and therefore unpredictable results may occur.

Option 5 is included to help maintain backwards compatibility - and requires all characters to be in upper case, i.e. UCase(value) = value. For example, if you pass in YYYY-MM-DD it will be internally converted to yyyy-MM-dd and returns YMD.

This issue fixed relates to option 5 not working as expected.

In addition, the comment for dayMonthYearOrder parameter used in various DateUtilities functions has been updated to note "A String of either DMY, MDY, YMD or a valid .NET date format string, see http://msdn.microsoft.com/en-us/library/73ctwf33(v=vs.90).aspx, to indicate the order of Days, Months and Years.". This internally calls DateUtilities.DayMonthYearOrderFromFormatString, so the same rules apply.