Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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_DATETIME,<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_DATETIME,Long]" to use the culture's long format, or "[SRP_DATETIME,MM/DD/YYYY h:mm:ss tt]" to set a custom format.

...

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,()(MM)(/DD/YYYY) (YYhh:mm:ss)]"

Examples

Code Block
languagebp
// IConv a datetime using the default format and the current locale as a guide
Datetime = IConv("1/14/2020 9:58 AM", "[SRP_DATETIME]")

// IConv a datetime using the long format and the current locale as a guide
Datetime = IConv("Tuesday, January 14, 2020 9:58:22 AM", "[SRP_DATETIME,Long]")

// IConv a datetime using the long format and the Spanish language as a guide
Datetime = IConv("martes, 14 de enero de 2020 15:17:43", "[SRP_DATETIME,(es)Long]")

// IConv a datetime using a custom format and the Spanish-MEXICAN language as a guide
Datetime = IConv("enero 14, 2020 at 3:17:43 p. m.", "[SRP_DATETIME,(es-MX)MMMM D, YYYY 'at' h:mm:ss tt]")

...