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

Psl Laravel Package

azjezz/psl

PSL (PHP Standard Library) offers a consistent, well-typed set of safer, async-ready APIs to replace PHP primitives. Covers async, collections, networking, I/O, cryptography, terminal UI, and type-safe data validation with predictable errors.

View on GitHub
Deep Wiki
Context7

DateTime

The DateTime component provides immutable, timezone-aware date and time types. It replaces PHP's mutable DateTime class with a design where every operation returns a new instance, eliminating an entire class of mutation bugs.

The component is built around several core types: DateTime for calendar-aware dates, Timestamp for raw points in time, Duration for exact time spans, Period for calendar-based periods, and Interval for time ranges.

Creating Dates

@example('system/datetime-creation.php')

Timestamps

A Timestamp represents a precise point in time as seconds and nanoseconds since the Unix epoch, independent of any timezone:

@example('system/datetime-timestamp.php')

Use Timestamp::monotonic() for duration measurements -- it uses a monotonic clock unaffected by system time adjustments.

Duration and Arithmetic

Duration represents an exact time span (hours, minutes, seconds, nanoseconds). All values are normalized automatically:

@example('system/datetime-duration.php')

Period

Period represents a calendar-based period (years, months, days). Unlike Duration, a period's actual time length depends on context - a month can be 28-31 days, and a day can be 23-25 hours due to DST. Months automatically normalize into years, but days are never normalized:

@example('system/datetime-period.php')

Interval

Interval represents a range between two points in time. It can check containment, overlap, and compute the exact duration between its endpoints:

@example('system/datetime-interval.php')

Convenience Methods

DateTime provides convenience methods for common boundary operations:

@example('system/datetime-convenience.php')

Comparing and Inspecting

@example('system/datetime-comparing.php')

Formatting and Parsing

@example('system/datetime-formatting.php')

Timezone Conversion

@example('system/datetime-timezone.php')

Interoperability

DateTime converts to and from PHP's DateTimeImmutable and ICU's IntlCalendar:

@example('system/datetime-interop.php')

See src/Psl/DateTime/ for the full API.

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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle