Supports using SRP_Time in an IConv.

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

Returns

A time in OI internal format.

Remarks

The "IConv" service adds support for using SRP_Time as a custom converter in IConv. All you have to do is set the IConv Conversion parameter to "[SRP_TIME]" 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 "[SRP_TIME,<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_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 IConv 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_TIME,()(hh):(mm):(ss)]"

Examples

// IConv a time using the default format and the current locale as a guide
Time = IConv("9:58 AM", "[SRP_TIME]")

// IConv a time using the long format and the current locale as a guide
Time = IConv("9:58:22 AM", "[SRP_TIME,Long]")

// IConv a time using the long format and the Spanish language as a guide
Time = IConv("15:17:43", "[SRP_TIME,(es)Long]")

// IConv a time using a custom format and the Spanish-MEXICAN language as a guide
Time = IConv("3:17:43 p. m.", "[SRP_TIME,(es-MX)h:mm:ss tt]")
  • No labels