Varien_Date
in package
Converter of date formats
Table of Contents
Constants
- DATE_INTERNAL_FORMAT = 'yyyy-MM-dd'
- DATE_PHP_FORMAT = 'Y-m-d'
- DATETIME_INTERNAL_FORMAT = 'yyyy-MM-dd HH:mm:ss'
- Date format, used as default. Compatible with Zend_Date
- DATETIME_PHP_FORMAT = 'Y-m-d H:i:s'
Properties
- $_convertZendToStrftimeDate : array<string|int, mixed>
- Zend Date To local date according Map array
- $_convertZendToStrftimeTime : array<string|int, mixed>
- Zend Date To local time according Map array
Methods
- convertZendToStrftime() : string
- Convert Zend Date format to local time/date according format
- formatDate() : string|null
- Format date to internal format
- now() : string
- Retrieve current date in internal format
- toTimestamp() : int
- Convert date to UNIX timestamp Returns current UNIX timestamp if date is true
- _convert() : string
- Convert value by dictionary
Constants
DATE_INTERNAL_FORMAT
public
mixed
DATE_INTERNAL_FORMAT
= 'yyyy-MM-dd'
DATE_PHP_FORMAT
public
mixed
DATE_PHP_FORMAT
= 'Y-m-d'
DATETIME_INTERNAL_FORMAT
Date format, used as default. Compatible with Zend_Date
public
mixed
DATETIME_INTERNAL_FORMAT
= 'yyyy-MM-dd HH:mm:ss'
DATETIME_PHP_FORMAT
public
mixed
DATETIME_PHP_FORMAT
= 'Y-m-d H:i:s'
Properties
$_convertZendToStrftimeDate
Zend Date To local date according Map array
private
static array<string|int, mixed>
$_convertZendToStrftimeDate
= ['yyyy-MM-ddTHH:mm:ssZZZZ' => '%c', 'EEEE' => '%A', 'EEE' => '%a', 'D' => '%j', 'MMMM' => '%B', 'MMM' => '%b', 'MM' => '%m', 'M' => '%m', 'dd' => '%d', 'd' => '%e', 'yyyy' => '%Y', 'yy' => '%Y', 'y' => '%Y']
$_convertZendToStrftimeTime
Zend Date To local time according Map array
private
static array<string|int, mixed>
$_convertZendToStrftimeTime
= ['a' => '%p', 'hh' => '%I', 'h' => '%I', 'HH' => '%H', 'H' => '%H', 'mm' => '%M', 'ss' => '%S', 'z' => '%Z', 'v' => '%Z']
Methods
convertZendToStrftime()
Convert Zend Date format to local time/date according format
public
static convertZendToStrftime(string $value[, bool $convertDate = true ][, bool $convertTime = true ]) : string
Parameters
- $value : string
- $convertDate : bool = true
- $convertTime : bool = true
Return values
stringformatDate()
Format date to internal format
public
static formatDate(int|string|Zend_Date|bool|null $date[, bool $includeTime = true ]) : string|null
Parameters
- $date : int|string|Zend_Date|bool|null
- $includeTime : bool = true
Return values
string|nullnow()
Retrieve current date in internal format
public
static now([bool $withoutTime = false ]) : string
Parameters
- $withoutTime : bool = false
-
day only flag
Return values
stringtoTimestamp()
Convert date to UNIX timestamp Returns current UNIX timestamp if date is true
public
static toTimestamp(Zend_Date|string|true $date) : int
Parameters
- $date : Zend_Date|string|true
Return values
int_convert()
Convert value by dictionary
protected
static _convert(string $value, array<string|int, mixed> $dictionary) : string
Parameters
- $value : string
- $dictionary : array<string|int, mixed>