Supports using SRP_Date in an IConv.

Date = IConv(String, "[SRP_DATE]")

Returns

A date in OI internal format.

Remarks

The "IConv" service adds support for using SRP_Date as a custom converter in IConv. All you have to do is set the IConv Conversion parameter to "[SRP_DATE]" and your data will be parsed using the default format for the user's current Windows locale settings.

Setting Format

If you want to set a format to guide the parsing process as explained in the Parse service, use IConv's branch option, which looks like this "[SRP_DATE,<branch>]". In this case, <branch> will be any value you would have passed to the Parse service's Format parameter. For example, you can use "[SRP_DATE,Long]" to use the culture's long format, or "[SRP_DATE,MM/DD/YYYY]" to set a custom format.

Setting Locale

If you want to set a locale, you can do it in the IConv branch by placing the locale name in parenthesis at the beginning of the branch. For example, "[SRP_DATE,(es-MX)Long]" sets the format to "Long" and locale to Spanish (Mexico). When you omit the locale, the user's current Windows culture is used.

If you need parenthesis in the format but don't want to specify a locale, you must prefix the branch with an empty parenthetical such as "[SRP_DATE,()(MM)(DD)(YY)]"

Examples

// IConv a date using the default format and the current locale as a guide
Date = IConv("1/14/2020", "[SRP_DATE]")

// IConv a date using the long format and the current locale as a guide
Date = IConv("Tuesday, January 14, 2020", "[SRP_DATE,Long]")

// IConv a date using the long format and the Spanish language as a guide
Date = IConv("martes, 14 de enero de 2020", "[SRP_DATE,(es)Long]")

// IConv a date using a custom format and the Spanish-MEXICAN language as a guide
Date = IConv("enero 14, 2020", "[SRP_DATE,(es-MX)MMMM D, YYYY]")
  • No labels