📆dateparser

dateparser is a natural language date/time parser for OutSystems applications. See below for the wide variety of formats dateparser will parse.

Installation

You can install dateparser from the OutSystems Forge component page: https://www.outsystems.com/forge/component-overview/14418/dateparser

Public API

  • ServiceAPIMethod Parse

    Attempts to parse a string into a DateTime (exceptions are raised).

    • InputParameter String (Text, Mandatory)

    • InputParameter Type (Integer)

      Past = -1, Future = 1, None = 0

    • OutputParameter DateTime (DateTime)

  • ServiceAPIMethod TryParse

    • InputParameter String (Text, Mandatory)

      e.g.: may 27th

    • InputParameter Type (Integer)

      Past = -1, Future = 1, None = 0

    • OutputParameter DateTime (DateTime)

Examples

dateparser demo app

dateparser can parse a huge variety of date and time formats. Following is a small sample of strings that will be properly parsed. Parsing is case-insensitive and will handle common abbreviations and misspellings.

For the cases where temporal time is not specific, it's possible to set Type parameter to indicate if the parsing should take into consideration past or future dates.

Example:

Parse "monday", type:past   = 2022-12-26 12:00:00
Parse "monday", type:future = 2023-01-02 12:00:00

Simple

Complex

  • 3 years ago (try it)

  • 5 months before now (try it)

  • 7 hours ago (try it)

  • 7 days from now (try it)

  • 1 week hence (try it)

  • 3 months ago saturday at 5:00 pm (try it)

  • 3rd month next year (try it)

  • 3rd thursday this september (try it)

  • 4th day last week (try it)

  • fourteenth of june 2010 at eleven o'clock in the evening (try it)

  • may seventh '97 at three in the morning (try it)

Specific Dates

Demo

You can see the component demo here.

Last updated