- Stricter time parsing by requiring time separators. For example,
949used to be parsed as09:49:00, but is now considered not valid. This is to help decrease false positives of nonsensical times such as25:00 am(incorrectly parsed as02:05:00). Thanks @fcapovilla (PR #46)
-
Correct handling of 12:xx:xx AM timestamps (12hr). These were incorrectly parsed as 12:xx:xx (24hr) timestamps when they should have been 00:xx:xx (24hr) timestamps.
-
Lock Timex to >= 3.2.1 and <= 3.7.2 to avoid timezone conversion issues when using
to_utc: true. Looks like there are some breaking changes (for us)
- Adjust tokenizer to prefer month/day before of day/month when those are the only found tokens. Thanks @mwean raising the issue.
- Add option
use_1904_date_systemfor the serial parser. It defaults tofalse. Most spreadsheet applications use the 1900 date system, but Microsoft Excel on Macintosh in particular used the 1904 date system [@fcapovilla].
- Change
parse_datetimeto no longer assume time. Previously, it would assume00:00:00if it could not be parsed. This is replaced with an opt-in optionassume_time. See next point. If you relied on this, to upgrade add the option; eg:DateTimeParser.parse_datetime(string, assume_time: true) - Change
parse_datetimeto no longer convert DateTime to UTC timezone. If you relied on this, to upgrade add the option; eg:DateTimeParser.parse_datetime(string, to_utc: true) - Change
parse_dateto no longer assume a date. Previously, it would assume the current date, and replace the found information from the string. This is replaced with an opt-in option ofassume_date. If you relied on this, to upgrade add the option; eg:DateTimeParser.parse_date(string, assume_date: true)
- Fix a UTC conversion bug between Daylight/Standard time (#20). If you're using an earlier version and converting to UTC, please upgrade to >= 1.0.0-rc2 immediately.
- Fix an epoch subsecond parsing bug (#16) (thanks @tmr08c)
- Updated for compatibility with Elixir 1.10.0
- Add
parse/2that will respond with the best match. This function accepts all options introduced below. - Change
parse_datetime/1toparse_datetime/2to accept options:assume_time: true | %Time{} | falsewith the default of false.
- Change
parse_date/1toparse_date/2to accept options:assume_date: true | %Date{} | falsewith the default of false.
- Add support for parsing negative epoch times. (#24) (thanks @tmr08c)
- Add bang variants,
parse!/2,parse_datetime!/2,parse_time!/2, andparse_date!/2 - Added
parsers: []option to add or disable parsers. This is helpful if you are don't want to consider Serial or Epoch timestamps.
- Add Serial time support
- Refactor
- Support subsecond parsing to 24 digits (yoctoseconds) [thanks @myfreeweb]
- Support parsing Unix epoch times from strings
- Fix microsecond parsing
- Validate days of month. Previously it would allow invalid days such as Feb 30. Now it will check if the year is a leap year and allow up to 29, and otherwise 28 for Feb. It will also reject day 31 on months without 31 days.
- Fix PM 12-hr conversion. The bug would convert 12:34PM to 24:34 which is not valid
- Add DateTimeParser.parse_datetime/2
- Add DateTimeParser.parse_date/1
- Add DateTimeParser.parse_time/1