OXID eShop CE
6.3.0
|
Public Member Functions | |
formatDBDate ($sDBDateIn, $blForceEnglishRet=false) | |
convertDBDateTime ($oObject, $blToTimeStamp=false, $blOnlyDate=false) | |
convertDBTimestamp ($oObject, $blToTimeStamp=false) | |
convertDBDate ($oObject, $blToTimeStamp=false) | |
getTime () | |
getRequestTime () | |
formatDBTimestamp ($iTimestamp) | |
getRoundedRequestDateDBFormatted ($roundTo) | |
getRequestTimeDBFormated () | |
formTime ($sTime='now', $sTime2=null) | |
shiftServerTime ($iTime) | |
getWeekNumber ($iFirstWeekDay, $sTimestamp=null, $sFormat=null) | |
german2English ($sDate) | |
isEmptyDate ($sDate) | |
Protected Member Functions | |
_setDefaultFormatedValue ($oObject, $sDate, $sLocalDateFormat, $sLocalTimeFormat, $blOnlyDate) | |
_defineAndCheckDefaultTimeValues ($blToTimeStamp) | |
_defineAndCheckDefaultDateValues ($blToTimeStamp) | |
_defaultDatePattern () | |
_defaultTimePattern () | |
_regexp2ValidateDateInput () | |
_regexp2ValidateTimeInput () | |
_defineDateFormattingRules () | |
_defineTimeFormattingRules () | |
_setDefaultDateTimeValue ($oObject, $sLocalDateFormat, $sLocalTimeFormat, $blOnlyDate) | |
_setDate ($oObject, $sDateFormat, $aDFields, $aDateMatches) | |
_formatCorrectTimeValue ($oObject, $sDateFormat, $sTimeFormat, $aDateMatches, $aTimeMatches, $aTFields, $aDFields) | |
_processDate ($aTime, $aDate, $blGerman, $sFormat) | |
Date manipulation utility class
|
protected |
sets default date pattern
|
protected |
sets default time pattern
|
protected |
defines and checks default date values
bool | $blToTimeStamp | marker how to format |
|
protected |
defines and checks default time values
bool | $blToTimeStamp | - |
|
protected |
define date formatting rules
|
protected |
defines time formatting rules
|
protected |
Formatting correct time value
object | $oObject | data field object |
string | $sDateFormat | date format |
string | $sTimeFormat | time format |
array | $aDateMatches | new new date |
array | $aTimeMatches | new time |
array | $aTFields | defines the time fields |
array | $aDFields | defines the date fields |
|
protected |
Processes amd formats date / time.
string | $aTime | splitted time ( array( H, m, s ) ) |
array | $aDate | splitted date ( array( Y, m, d ) ) |
bool | $blGerman | true if incoming string is in German format (dotted) |
string | $sFormat | date format to produce |
|
protected |
regular expressions to validate date input
|
protected |
regular expressions to validate time input
|
protected |
sets date
object | $oObject | date field object |
string | $sDateFormat | date format |
array | $aDFields | days |
array | $aDateMatches | new date as array (month, year) |
|
protected |
Sets default date time value
object | $oObject | date field object |
string | $sLocalDateFormat | input format |
string | $sLocalTimeFormat | local format |
bool | $blOnlyDate | marker to format only date field (no time) |
|
protected |
sets default formatted value
object | $oObject | date field object |
string | $sDate | preferred date |
string | $sLocalDateFormat | input format |
string | $sLocalTimeFormat | local format |
bool | $blOnlyDate | marker to format only date field (no time) |
OxidEsales\EshopCommunity\Core\UtilsDate::convertDBDate | ( | $oObject, | |
$blToTimeStamp = false |
|||
) |
Bidirectional converter for date field
object | $oObject | oxField type object that keeps db field info |
bool | $blToTimeStamp | if true - converts value to database compatible timestamp value |
OxidEsales\EshopCommunity\Core\UtilsDate::convertDBDateTime | ( | $oObject, | |
$blToTimeStamp = false , |
|||
$blOnlyDate = false |
|||
) |
Bidirectional converter for date/datetime field
object | $oObject | data field object |
bool | $blToTimeStamp | set TRUE to format MySQL compatible value |
bool | $blOnlyDate | set TRUE to format "date" type field |
OxidEsales\EshopCommunity\Core\UtilsDate::convertDBTimestamp | ( | $oObject, | |
$blToTimeStamp = false |
|||
) |
Bidirectional converter for timestamp field
object | $oObject | oxField type object that keeps db field info |
bool | $blToTimeStamp | if true - converts value to database compatible timestamp value |
OxidEsales\EshopCommunity\Core\UtilsDate::formatDBDate | ( | $sDBDateIn, | |
$blForceEnglishRet = false |
|||
) |
Format date to user defined format.
string | $sDBDateIn | Date to reformat |
bool | $blForceEnglishRet | Force to return primary value(default false) |
OxidEsales\EshopCommunity\Core\UtilsDate::formatDBTimestamp | ( | $iTimestamp | ) |
Returns the the timestamp formatted as date string for the database
int | $iTimestamp | the timestamp to be formatted |
OxidEsales\EshopCommunity\Core\UtilsDate::formTime | ( | $sTime = 'now' , |
|
$sTime2 = null |
|||
) |
Form time
string | $sTime | time to create timestamp. |
string | $sTime2 | hours, minutes and seconds to update created timestamp. |
OxidEsales\EshopCommunity\Core\UtilsDate::german2English | ( | $sDate | ) |
Reformats and returns German date string to English.
string | $sDate | German format date string |
OxidEsales\EshopCommunity\Core\UtilsDate::getRequestTime | ( | ) |
Returns time wen the request was started according shop timezone configuration. Configures in Admin -> Main menu -> Core Settings -> General REQUEST TIME is faster because it is not an syscall like time
OxidEsales\EshopCommunity\Core\UtilsDate::getRequestTimeDBFormated | ( | ) |
Returns the the request time formatted as date string for the database
OxidEsales\EshopCommunity\Core\UtilsDate::getRoundedRequestDateDBFormatted | ( | $roundTo | ) |
Returns the the timestamp formatted as date string for the database
int | $roundTo | a amount of seconds to be rounded to e.g. 300 for rounding to 5 minutes |
OxidEsales\EshopCommunity\Core\UtilsDate::getTime | ( | ) |
Returns time according shop timezone configuration. Configures in Admin -> Main menu -> Core Settings -> General
OxidEsales\EshopCommunity\Core\UtilsDate::getWeekNumber | ( | $iFirstWeekDay, | |
$sTimestamp = null , |
|||
$sFormat = null |
|||
) |
Returns number of the week according to numeration standards (configurable in admin): U - week number, starting with the first Sunday as the first day of the first week; W - week number, starting with the first Monday as the first day of the first week.
int | $iFirstWeekDay | if set formats with U, otherwise with W ($myConfig->getConfigParam( 'iFirstWeekDay' )) |
string | $sTimestamp | timestamp, default is null (returns current week number); |
string | $sFormat | calculation format ( "%U" or "%w"), default is null (returns "%W" or defined in admin ). |
OxidEsales\EshopCommunity\Core\UtilsDate::isEmptyDate | ( | $sDate | ) |
Checks if date string is empty date field. Empty string or string with all date values equal to 0 is treated as empty.
array | $sDate | date or date time string |
OxidEsales\EshopCommunity\Core\UtilsDate::shiftServerTime | ( | $iTime | ) |
Shift time if needed by configured timezone.
int | $iTime |