Supports using SRP_Date in an OConv.

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

Returns

A formatted string containing a human readable date.

Remarks

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

Setting Format

If you want to set the format used to render the date, use OConv's branch option, which looks like this "[SRP_DATE,<branch>]". In this case, <branch> will be any value you would have passed to the Format 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 OConv 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)/(YYYY)]"

Examples

// Create an OI date
Date = SRP_Date("Encode", 2020, 1, 14)
 
// OConv a date using the default format and the current locale
Text = OConv(Date, "[SRP_DATE]")
 
// OConv a date using the long format and the current locale
Text = OConv(Date, "[SRP_DATE,Long]")
 
// OConv a date using the long format and the Spanish language
Text = OConv(Date, "[SRP_DATE,(es)Long]")
 
// OConv a date using a custom format and the Spanish-MEXICAN language
Text = OConv(Date, "[SRP_DATE,(es-MX)MMMM D, YYYY]")
  • No labels