📆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
Parse
Attempts to parse a string into a DateTime (exceptions are raised).
String (Text, Mandatory)
Type (Integer)
Past = -1, Future = 1, None = 0
DateTime (DateTime)
TryParse
String (Text, Mandatory)
e.g.: may 27th
Type (Integer)
Past = -1, Future = 1, None = 0
DateTime (DateTime)
Examples

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
last friday at 20:00 (try it)
last week tuesday (try it)
tomorrow at 6:45pm (try it)
thursday last week (try it)
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
January 5 (try it)
22nd of june (try it)
5th may 2017 (try it)
February twenty first (try it)
dec 25 (try it)
february 14, 2004
february 14th, 2004 (try it)
17 april 85 (try it)
27/5/1979 (try it)
etc.
Demo
You can see the component demo here.
Last updated