Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Gotime Laravel Package

dcarbone/gotime

Go-inspired time utilities for PHP 8.1+: a Duration type (parse/format like 5s, JSON as nanoseconds) plus helpers to generate DateInterval specs for DateTime add/sub. Includes a Time wrapper around DateTime aiming for Go time.Time-style APIs.

View on GitHub
Deep Wiki
Context7
v1.0.0

What's Changed

New Contributors

Full Changelog: https://github.com/dcarbone/gotime/compare/v0.6.1...v1.0.0

v0.6.0
v0.5.1
  • Setting jsonSerialize method on Weekday, Month, and Duration classes to : mixed to support downstream overloading
  • Specifying some class property types
v0.4.6
  • Adds gha to v0.4.x series
  • Limits support to sub php 8.0
v0.4.4

Removed :int typehint on jsonSerialize method to allow for more flexible overloading of the json representation of the Duration type.

v0.4.2
  • Added methods to Time class:
    • Until
    • UntilDateTime
    • Since
    • SinceDateTime
  • Added ability to "cast" \DateInterval type to Time\Duration type
  • Fixed possible float != int exception on Time\Time::Nanoseconds() method
  • Fixed tests so they work with newer phpunits
  • Added more tests
v0.4.0
  • Updates required php version to 7.2+
  • Adds Time::Duration method to provide "cast"-like abilities with strings, integers, floats, and instances of Duration
  • Misc cleanup
0.3.0

This release does little functionally other than enforce strict typing package-wide and adjust the formatting slightly.

Version iterated in case users were using lazy typing.

0.2.4

Addresses issue where a zero Duration would be returned when using Time::ParseDuration with value containing > 1 decimal point of precision (i.e. Time::ParseDuration('0.05s');)

0.2.3

Time\Time::getErrorString now correctly returns the formatted error string. Before, the output was ignored.

0.2.2

Using the string format of microtime() over the float value to prevent issues with float -> string casting.

0.2.1

This release turns Time\Time::AddDuration and Time\Time::SubDuration into fluent methods, and some test cases around this.

0.2.0
0.1.2

Fixes issue with float value parsing in duration strings.

0.1.1

Added api-compatible Duration::Truncate() and Duration::Round() methods, as well as Duration::Compare() to help the with the fact that this is not go.

Also added some tests.

0.1.0

This initial release includes a simplified implementation of time.Duration and some basic documentation.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor