- In theory you should not need to convert date/time values, but in practice...
- A real world lab message with non-standard date/time format
- Non-conformant Lab Result Message
- What the bare bones of the Translator gives you
- Using the fuzzy date/time parser
- Ambiguous Date/Time Formats
- Complete documentation for the fuzzy date/time parser
- Using os.date to output arbitrary date/time formats
- Don't be afraid to mix in a bit of string parsing
- Some user suggestions for other useful date/time libraries
The core of the Iguana Translator has very little built in support for date and time formats. Every node is treated as a string. If you try to assign a date/time of the wrong format to a date/time field in a table an error will be raised.
This is deliberate part of the minimalist design philosophy of the Translator.
However one of our rockstars has written a fuzzy date/time parser in Lua which parses just about any date. It’s very nice since it means except for a few special cases you can avoid the need to ever have to explicitly worry about converting date/time formats. Less than 300 lines of simple code that will save literally millions of dollars globally in the industry on unnecessary busy work.
Download dateparse.lua from our code repository
The source code for the fuzzy date/time matcher can be downloaded from our code repository. To use it you should create a shared module like dateparse and then just copy-paste the code into the module.