Weave 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
Intl Date Time

Intl Date Time Laravel Package

techouse/intl-date-time

Locale-aware date and time formatting for Laravel powered by PHP's Intl extension. Provides Carbon macros, Blade directives, validation rules, and easy localization of dates across your app, with dozens of locales supported out of the box. Simple to configure and use.

View on GitHub
Deep Wiki
Context7

techouse/intl-date-time adds locale-aware date and time formatting to Laravel via PHP’s IntlDateFormatter. It formats Carbon, native DateTime, and timestamp values using ICU patterns, so output follows your app’s configured locale and timezone instead of hard-coded PHP date formats.

  • Locale-aware formatting with ICU date/time patterns
  • Supports Carbon, DateTime, and timestamps
  • Configurable default locale and timezone
  • Laravel-friendly facade/helper for concise usage
  • Lightweight wrapper around the PHP Intl extension
Frequently asked questions about Intl Date Time
How do I install techouse/intl-date-time in a Laravel app?
Install it with Composer by running composer require techouse/intl-date-time from your Laravel project root. Laravel's package auto-discovery registers the service provider, so no manual provider entry is needed. Make sure the PHP Intl extension is enabled on your runtime before you rely on formatting.
Does it format Carbon instances, native DateTime objects, and timestamps?
Yes. The package accepts Carbon instances, native DateTime objects, and raw timestamp values, so you can format dates from Eloquent casts, request input, or legacy code through the same API. Every value is rendered with PHP's IntlDateFormatter using an ICU pattern.
How do I format a date using an ICU pattern with this package?
Pass an ICU date or time pattern to the facade or helper and the package formats the value according to the configured locale and timezone. ICU patterns let you control month and weekday names, day-month ordering, and 12-hour versus 24-hour output. The same pattern produces different but correct output for each locale.
How do I set the default locale and timezone for formatting?
The package reads your application's configured locale and timezone by default, so most apps need no extra setup. If you need package-level overrides, publish its configuration file and set the default locale and timezone there. This keeps display formatting aligned with the rest of your app's localization settings.
Can I use it directly in Blade templates?
Yes, the package exposes Blade directives in addition to the facade and helper, so you can format dates directly in your views. This keeps templates free of hard-coded PHP date format strings. For testability you may still prefer formatting in a view model or presenter.
What Laravel and PHP versions does it support?
The package targets modern Laravel releases on current PHP versions and requires the PHP Intl extension. Exact constraints are pinned in its composer.json, so compare that file against your application's Laravel and PHP versions before installing. There are no migration or database requirements.
Does it provide validation rules for localized date input?
Yes. The package includes validation rules intended for localized date input, letting you accept dates in a user's locale-specific format and validate them before storage. Pair them with a datetime cast and store values in a consistent format such as ISO-8601 in UTC. Treat any locale-formatted string coming from a client as presentation only.
How is it different from Carbon's formatting or PHP's date() function?
PHP's date() and Carbon's default formatting use fixed format characters, so ordering and names stay the same regardless of locale. This package uses ICU patterns through IntlDateFormatter, meaning day-month ordering, month and weekday names, and 12/24-hour conventions follow the target locale. That makes it a better fit for apps serving users across multiple locales.
What happens if the PHP Intl extension is not installed?
The package is a lightweight wrapper around PHP's Intl extension, so that extension must be installed and enabled; it is a hard dependency, not a soft one. Without it, IntlDateFormatter is unavailable and formatting calls will fail. Verify the extension on your runtime image and in CI as part of setup.
Is it suitable for production, and how should timezones be stored?
It is a small, stateless formatting layer with no migrations or data model changes, so production risk stays low when versions are pinned. Store dates in UTC in ISO-8601 and format only at display time to avoid off-by-one-day errors and daylight-saving drift. Because it is maintained by a single author, review repository activity and lock the version in composer.lock like any other dependency.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo