All Projects → ribice → dt

ribice / dt

Licence: Apache-2.0 license
Go's missing DateTime package

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to dt

rutimeparser
Recognize date and time in russian text and return datetime.datetime.
Stars: ✭ 17 (-50%)
Mutual labels:  time, datetime, date
hs-hourglass
efficient and simpler time API for haskell
Stars: ✭ 43 (+26.47%)
Mutual labels:  time, datetime, date
Gostradamus
Gostradamus: Better DateTimes for Go 🕰️
Stars: ✭ 148 (+335.29%)
Mutual labels:  time, datetime, date
Tail.datetime
A lightweight, translat- and configurable Open Source DateTime Picker, written in pure vanilla JavaScript!
Stars: ✭ 139 (+308.82%)
Mutual labels:  time, datetime, date
qrono
🕥 Just right date time library
Stars: ✭ 111 (+226.47%)
Mutual labels:  time, datetime, date
Delorean
Delorean: Time Travel Made Easy
Stars: ✭ 1,793 (+5173.53%)
Mutual labels:  time, datetime, date
Date
A date and time library based on the C++11/14/17 <chrono> header
Stars: ✭ 2,389 (+6926.47%)
Mutual labels:  time, datetime, date
Luatz
Time, Date and Timezone library for lua
Stars: ✭ 92 (+170.59%)
Mutual labels:  time, datetime, date
ptera
Ptera is DateTime library for Deno
Stars: ✭ 62 (+82.35%)
Mutual labels:  time, datetime, date
Jiffy
Jiffy is a Flutter (Android, IOS and Web) date time package inspired by momentjs for parsing, manipulating, querying and formatting dates
Stars: ✭ 238 (+600%)
Mutual labels:  time, datetime, date
Calendar
📅 PHP Date & Time library that solves common problems in object oriented, immutable way.
Stars: ✭ 113 (+232.35%)
Mutual labels:  time, datetime, date
lit-date
Light-weight, faster datetime formatter for modern browsers.
Stars: ✭ 33 (-2.94%)
Mutual labels:  time, datetime, date
Time Stamp
Get a formatted timestamp. Used in gulp, assemble, generate, and many others.
Stars: ✭ 104 (+205.88%)
Mutual labels:  time, datetime, date
Date Picker
📅 Custom responsive date picker widget for Android, written in Kotlin.
Stars: ✭ 146 (+329.41%)
Mutual labels:  time, datetime, date
Dateparse
GoLang Parse many date strings without knowing format in advance.
Stars: ✭ 1,365 (+3914.71%)
Mutual labels:  time, datetime, date
Time
Building a better date/time library for Swift
Stars: ✭ 1,983 (+5732.35%)
Mutual labels:  time, datetime, date
Carbon
A simple PHP API extension for DateTime
Stars: ✭ 75 (+120.59%)
Mutual labels:  time, datetime, date
Graphql Java Datetime
GraphQL ISO Date is a set of RFC 3339 compliant date/time scalar types to be used with graphql-java.
Stars: ✭ 89 (+161.76%)
Mutual labels:  time, datetime, date
Dpicker
A framework-agnostic minimal date picker
Stars: ✭ 187 (+450%)
Mutual labels:  time, datetime, date
iso8601
A fast ISO8601 date parser for Go
Stars: ✭ 122 (+258.82%)
Mutual labels:  time, datetime, date

dt

Go's missing DateTime package

Build Status codecov Go Report Card

Why dt?

Go's standard library contains a single date package - time. The type provided by it, Time, contains date, time and location information.

More often than not we don't need location info, or we need to represent date/time only.

dt provides exactly that, a time-zone-independent representation of time that follows the rules of the proleptic Gregorian calendar with exactly 24-hour days, 60-minute hours, and 60-second minutes.

What is provided?

dt provides three types to work with:

  • Time: Contains time info: HH:mm
  • Date: Contains date info: YYYY-MM-DD
  • DateTime: Contains date and time information: YYYY-MM-DDTHH:mm

Unlike time.Time these types contain an additional Valid field representing whether the data inside it was scanned/marshaled. This prevents situations like saving default date in a database when nothing was received or responding via JSON with default date even though the date was empty.

Types provided in dt represent sql types time, date and timestamp.

Why not civil package?

Google already offers something similar in civil package.

  • It's not an independent library, but a small package in a very big project which leads to its problems.
  • It doesn't implement the Scan/Value SQL interfaces.
  • It marshalls to zero date/time/datetime (time.Time does this as well.) You can't differentiate inputted zero date/time/datetime and empty value.
  • Slower development cycle

License

dt is licensed under the Apache2 license. Check the LICENSE file for details.

Author

Emir Ribic

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].