Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. dateparse

dateparse

MITGo

A Go library that parses date strings without requiring prior knowledge of their format.

GitHubGitHub
2.1k stars174 forks0 contributors

What is dateparse?

Dateparse is a Go library that intelligently parses date and time strings without requiring the format to be specified beforehand. It solves the problem of handling diverse date formats in data processing, log parsing, or user input by automatically detecting the format using a state machine. This eliminates the need for multiple parsing attempts or complex format-matching logic.

Target Audience

Go developers working with heterogeneous date sources, such as log files, CSV data, APIs, or user-generated content where date formats are inconsistent or unknown.

Value Proposition

Developers choose Dateparse for its performance and convenience—it's faster than trial-and-error parsing and reduces boilerplate code. Its strict mode and layout detection provide flexibility and control, making it a robust alternative to Go's standard time.Parse.

Overview

GoLang Parse many date strings without knowing format in advance.

Use Cases

Best For

  • Parsing log files with mixed date formats
  • Processing CSV or JSON data with inconsistent date strings
  • Handling user input where date format is unpredictable
  • Converting legacy data with various date representations
  • Building tools that need to accept dates in multiple formats
  • Debugging date parsing issues by detecting the layout

Not Ideal For

  • Projects where date formats are strictly known and consistent, making Go's standard time.Parse more appropriate for simplicity and control
  • Applications requiring unambiguous resolution of mm/dd vs dd/mm dates without failing, as Dateparse's strict mode only errors out rather than providing alternatives
  • Systems with highly custom or proprietary date formats not covered by Dateparse's scanner, which might require a bespoke parser
  • Environments where server timezone configuration cannot be controlled, leading to potential parsing inconsistencies due to Dateparse's reliance on local time settings

Pros & Cons

Pros

Wide Format Support

Parses numerous date-time formats including RFC, ISO, Unix timestamps, and localized variations, as demonstrated by the extensive list of over 70 examples in the README.

Performance Optimized

Uses a state machine and scanner approach, making it significantly faster than brute-force parsing methods, with benchmarks provided in bench_test.go.

Strict Mode Control

Offers ParseStrict to error on ambiguous dates like mm/dd vs dd/mm, giving developers the ability to enforce unambiguous parsing when needed, as highlighted in the README warnings.

Layout Detection

Includes ParseFormat to return the Go layout string for a given date, useful for debugging or transforming dates into specific formats, shown in the code example.

Cons

Ambiguity Defaults

Defaults to mm/dd/yyyy for ambiguous dates, which may not align with regional preferences, and strict mode simply fails without offering alternative parsing strategies, as admitted in the README.

Timezone Dependency

Parsing results are affected by the server's configured timezone, as noted in the README, which can lead to unexpected behavior if not properly managed, requiring extra configuration like ParseLocal.

Limited to Scanned Formats

While comprehensive, the library may not support every possible date format, especially non-standard or evolving formats, relying on updates to the internal scanner and state machine.

Frequently Asked Questions

Quick Stats

Stars2,145
Forks174
Contributors0
Open Issues48
Last commit2 years ago
CreatedSince 2014

Tags

#datetime#time-parsing#dates#time#state-machine#cli-tool#golang-library#golang#date#date-parsing#go

Built With

G
Go

Included in

Go169.1k
Auto-fetched 5 hours ago

Related Projects

carboncarbon

A simple, semantic and developer-friendly time package for golang

Stars5,225
Forks266
Last commit3 days ago
nownow

Now is a time toolkit for golang

Stars4,699
Forks240
Last commit5 months ago
carboncarbon

Carbon for Golang, an extension for Time

Stars781
Forks55
Last commit2 years ago
durafmtdurafmt

:clock8: Better time duration formatting in Go!

Stars513
Forks51
Last commit5 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub