-
Notifications
You must be signed in to change notification settings - Fork 34
classes_essentials_localization_datetimeformat.class
Helper class to deal with datetime values.
Formats a detetime value to a string.
Definition: public function Format($date, $format_id)
Returns: string Formatted string
Parameters:
-
\DateTime|array|int $dateTime value (see time) -
int $format_idFormat identifier (one of the DateTimeFormta::DT_* constants)
Returns all known DateTime patterns. These are the basic ones referred to by the DF_* constants plus the following combinations (separated by space):
- DF_SHORTDATE DF_SHORTTIME
- DF_LONGDATE DF_SHORTTIME
- DF_SHORTDATE DF_LONGTIME
- DF_LONGDATE DF_LONGTIME
Definition: public function KnownDateTimePatterns()
Returns: array Array of format strings
Converts a string to a unix timestamp. Tries all KnownDateTimePatterns() and uses the best match. Known Bugs:
- Culture cs-CZ Format dd MMMM
- Culture mt-MT Format dddd, d' ta' 'MMMM yyyy
- Culture mt-MT Format dddd, d' ta' 'MMMM yyyy HH:mm:ss
- Culture vi-VN Format dd MMMM
Definition: public function StringToTime($str)
Returns: int|false The timestamp or FALSE on error
Parameters:
-
string $strInput string in one of the KnownDateTimePatterns()