mezon/date-time-utils

Small date/time utilities

Installs: 3 052

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 3

Forks: 0

Open Issues: 0

pkg:composer/mezon/date-time-utils

1.0.5 2021-05-01 14:27 UTC

This package is auto-updated.

Last update: 2025-09-29 02:57:52 UTC


README

Installation

Just print

composer require mezon/date-time-utils

Locale setup

You can specify necessary locale by setting up the DateTimeUtils::$locale variable. For example:

DateTimeUtils::$locale = 'en';

Methods

Method returns true if the passed date is today

DateTimeUtils::isToday(string $date):bool

Method returns true if the passed date was yesterday

DateTimeUtils::isYesterday(string $date):bool

Method returns day and literal representation of month from the date. For example the string "1 of july" will be returned for the date '2020-07-01'

DateTimeUtils::dayMonth(string $date): string