Supports using SRP_Time in an OConv.

String = OConv(Time, "[SRP_TIME]")

Returns

A formatted string containing a human readable time.

Remarks

The "OConv" service adds support for using SRP_Time as a custom converter in OConv. All you have to do is set the OConv Conversion parameter to "[SRP_TIME]" and yourtime 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 time, use OConv's branch option, which looks like this "[SRP_TIME,<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_TIME,Long]" to use the culture's long format, or "[SRP_TIME,h:mm:ss tt]" 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_TIME,(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_DATETIME,()(hh):(mm):(ss)]"

Examples

// Create an OI time
Time = SRP_Time("Encode", 3, 7, 43)
 
// OConv a time using the default format and the current locale
Text = OConv(Time, "[SRP_TIME]")
 
// OConv a time using the long format and the current locale
Text = OConv(Time, "[SRP_TIME,Long]")
 
// OConv a time using the long format and the Spanish language
Text = OConv(Time, "[SRP_TIME,(es)Long]")
 
// OConv a time using a custom format and the Spanish-MEXICAN language
Text = OConv(Time, "[SRP_TIME,(es-MX)h:mm:ss tt]")
  • No labels