TimeDate
in package
TimeDate Class
The TimeDate class provides methods for formatting time and date strings.
Table of Contents
Methods
- formatDate() : string
- Format a date string in "YYYY-MM-DD" format to "DD/MM/YYYY" format.
- formatDatetime() : string
- Format a datetime string.
- formatTime() : string
- Format a time string.
Methods
formatDate()
Format a date string in "YYYY-MM-DD" format to "DD/MM/YYYY" format.
public
static formatDate(string $inputDate) : string
Parameters
- $inputDate : string
-
The input date in "YYYY-MM-DD" format.
Return values
string —The formatted date in "DD/MM/YYYY" format.
formatDatetime()
Format a datetime string.
public
static formatDatetime(string $datetime) : string
Parameters
- $datetime : string
-
The datetime string.
Return values
string —The formatted datetime string in "D - d M, Y H:i" format.
formatTime()
Format a time string.
public
static formatTime(string $time) : string
Parameters
- $time : string
-
The time string in HH:MM format.
Return values
string —The formatted time string with AM/PM.