DateTimeFormat
class DateTimeFormat
An easy-to-use list of date/time formats
How to understand the constants
-
D_
prefix -> date format -
T_
prefix -> time format -
DMY
,YMD
andMDY
specify the order of day, month and year -
_NO_LEAD
suffix means no leading zeros -
T_12
LOWER
/UPPER
point to AM/am, PM/pm
Constants
D_DMY_DOTS |
|
D_DMY_DOTS_NO_LEAD |
|
D_DMY_SLASHES |
|
D_DMY_SLASHES_NO_LEAD |
|
D_DMY_DASHES |
|
D_DMY_DASHES_NO_LEAD |
|
D_YMD_DOTS |
|
D_YMD_DOTS_NO_LEAD |
|
D_YMD_SLASHES |
|
D_YMD_SLASHES_NO_LEAD |
|
D_YMD_DASHES |
|
D_YMD_DASHES_NO_LEAD |
|
D_MDY_DOTS |
|
D_MDY_DOTS_NO_LEAD |
|
D_MDY_SLASHES |
|
D_MDY_SLASHES_NO_LEAD |
|
D_MDY_DASHES |
|
D_MDY_DASHES_NO_LEAD |
|
T_24 |
|
T_24_NO_LEAD |
|
T_12_LOWER |
|
T_12_LOWER_NO_LEAD |
|
T_12_UPPER |
|
T_12_UPPER_NO_LEAD |
|
Methods
Checks if give time string is indeed in the format specified.
Details
at line 70
static bool
validate(string $format, string $timeString)
Checks if give time string is indeed in the format specified.
Some leading zeros check might be omitted.