You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parse many date strings without knowing format in advance. Validates comprehensively to avoid false positives. Uses a scanner to read bytes with a statemachine to find format. Much faster than shotgun based parse methods. See [bench_test.go](https://github.com/araddon/dateparse/blob/master/bench_test.go) for performance comparison. See the critical note below about timezones.
7
+
Parse date/time strings without knowing the format in advance. Supports 100+ formats. Validates comprehensively to avoid false positives. Very fast (~single-pass state-machine based approach). See [bench_test.go](https://github.com/itlightning/dateparse/blob/main/bench_test.go) for performance comparison. See the critical note below about timezones.
5
8
9
+
⚡ Maintained by [IT Lightning](https://itlightning.com/), a cloud-first logging platform that's uniquely powerful, super-easy (schemaless, point-and-shoot ingestion), and affordable. It automatically extracts and classifies structured data out of your unstructured log messages. Enjoy visual pattern-analysis and robust SQL-like search. It's unique architecture means you can log more and pay less. Check it out and give us feedback! ⚡
🐛💡 Find a bug or have an idea with this package? [Issues](https://github.com/itlightning/dateparse/issues) and pull requests are welcome.
11
12
12
-
**MM/DD/YYYY VS DD/MM/YYYY** Right now this uses mm/dd/yyyy WHEN ambiguous if this is not desired behavior, use `ParseStrict` which will fail on ambiguous date strings. This can be adjusted using the `PreferMonthFirst` parser option. Some ambiguous formats can fail (e.g., trying to parse 31/03/2023 as the default month-first format `MM/DD/YYYY`), but can be automatically retried with `RetryAmbiguousDateWithSwap`.
13
+
14
+
History and Contributors
15
+
----------------------------------
16
+
17
+
This is an actively maintained fork of the excellent [original dateparse package](https://github.com/araddon/dateparse) by [@araddon](https://github.com/araddon).
18
+
This fork [incorporates](https://github.com/araddon/dateparse/pull/159) many bugfixes from the community, and adds comprehensive validation and extensive performance optimizations.
19
+
A special thanks to [@araddon](https://github.com/araddon), other contributors to the original project, as well as those who contributed fixes that got incorporated into this version:
**MM/DD/YYYY VS DD/MM/YYYY** Right now this uses mm/dd/yyyy *when* ambiguous. If this is not desired behavior, use `ParseStrict` which will fail on ambiguous date strings. This behavior can be adjusted using the `PreferMonthFirst` parser option. Some ambiguous formats can fail (e.g., trying to parse 31/03/2023 as the default month-first format `MM/DD/YYYY`), but can be automatically retried with `RetryAmbiguousDateWithSwap`.
**Timezones**The location your server is configured affects the results! See example or https://play.golang.org/p/IDHRalIyXh and last paragraph here https://golang.org/pkg/time/#Parse.
62
+
The location that your server is configured to affects the results! See example or https://play.golang.org/p/IDHRalIyXh and last paragraph here https://golang.org/pkg/time/#Parse.
46
63
47
64
Important points to understand:
48
65
* If you are parsing a date string that does *not* reference a timezone, if you use `Parse` it will assume UTC, or for `ParseIn` it will use the specified location.
@@ -56,13 +73,13 @@ Important points to understand:
0 commit comments