PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Alexey Dodonov   Mezon PHP Date Time Functions Utilities   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Mezon PHP Date Time Functions Utilities
Perform useful operations with date and time
Author: By
Last change:
Date: 3 years ago
Size: 706 bytes
 

Contents

Class file image Download

Utilities for data manipulation

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