OXID eShop CE  4.10.8
 All Classes Namespaces Files Functions Variables Pages
oxUtilsDate Class Reference
+ Inheritance diagram for oxUtilsDate:
+ Collaboration diagram for oxUtilsDate:

Public Member Functions

 formatDBDate ($sDBDateIn, $blForceEnglishRet=false)
 convertDBDateTime ($oObject, $blToTimeStamp=false, $blOnlyDate=false)
 convertDBTimestamp ($oObject, $blToTimeStamp=false)
 convertDBDate ($oObject, $blToTimeStamp=false)
 getTime ()
 formTime ($sTime= 'now', $sTime2=null)
 shiftServerTime ($iTime)
 getWeekNumber ($iFirstWeekDay, $sTimestamp=null, $sFormat=null)
 german2English ($sDate)
 isEmptyDate ($sDate)
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 __construct ()
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

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)

Additional Inherited Members

- Static Protected Attributes inherited from oxSuperCfg
static $_oConfig = null
static $_oSession = null
static $_oRights = null
static $_oActUser = null
static $_blIsAdmin = null

Detailed Description

Date manipulation utility class

Definition at line 6 of file oxutilsdate.php.

Member Function Documentation

oxUtilsDate::_defaultDatePattern ( )
protected

sets default date pattern

Returns
array

Definition at line 351 of file oxutilsdate.php.

oxUtilsDate::_defaultTimePattern ( )
protected

sets default time pattern

Returns
array

Definition at line 367 of file oxutilsdate.php.

oxUtilsDate::_defineAndCheckDefaultDateValues (   $blToTimeStamp)
protected

defines and checks default date values

Parameters
bool$blToTimeStampmarker how to format
Returns
string

Definition at line 334 of file oxutilsdate.php.

oxUtilsDate::_defineAndCheckDefaultTimeValues (   $blToTimeStamp)
protected

defines and checks default time values

Parameters
bool$blToTimeStamp-
Returns
string

Definition at line 315 of file oxutilsdate.php.

oxUtilsDate::_defineDateFormattingRules ( )
protected

define date formatting rules

Returns
array

Definition at line 415 of file oxutilsdate.php.

oxUtilsDate::_defineTimeFormattingRules ( )
protected

defines time formatting rules

Returns
array

Definition at line 431 of file oxutilsdate.php.

oxUtilsDate::_formatCorrectTimeValue (   $oObject,
  $sDateFormat,
  $sTimeFormat,
  $aDateMatches,
  $aTimeMatches,
  $aTFields,
  $aDFields 
)
protected

Formatting correct time value

Parameters
object$oObjectdata field object
string$sDateFormatdate format
string$sTimeFormattime format
array$aDateMatchesnew new date
array$aTimeMatchesnew time
array$aTFieldsdefines the time fields
array$aDFieldsdefines the date fields

Definition at line 506 of file oxutilsdate.php.

oxUtilsDate::_processDate (   $aTime,
  $aDate,
  $blGerman,
  $sFormat 
)
protected

Processes amd formats date / time.

Parameters
string$aTimesplitted time ( array( H, m, s ) )
array$aDatesplitted date ( array( Y, m, d ) )
bool$blGermantrue if incoming string is in German format (dotted)
string$sFormatdate format to produce
Returns
string formatted string

Definition at line 660 of file oxutilsdate.php.

oxUtilsDate::_regexp2ValidateDateInput ( )
protected

regular expressions to validate date input

Returns
array

Definition at line 383 of file oxutilsdate.php.

oxUtilsDate::_regexp2ValidateTimeInput ( )
protected

regular expressions to validate time input

Returns
array

Definition at line 399 of file oxutilsdate.php.

oxUtilsDate::_setDate (   $oObject,
  $sDateFormat,
  $aDFields,
  $aDateMatches 
)
protected

sets date

Parameters
object$oObjectdate field object
string$sDateFormatdate format
array$aDFieldsdays
array$aDateMatchesnew date as array (month, year)

Definition at line 477 of file oxutilsdate.php.

oxUtilsDate::_setDefaultDateTimeValue (   $oObject,
  $sLocalDateFormat,
  $sLocalTimeFormat,
  $blOnlyDate 
)
protected

Sets default date time value

Parameters
object$oObjectdate field object
string$sLocalDateFormatinput format
string$sLocalTimeFormatlocal format
bool$blOnlyDatemarker to format only date field (no time)

Definition at line 450 of file oxutilsdate.php.

oxUtilsDate::_setDefaultFormatedValue (   $oObject,
  $sDate,
  $sLocalDateFormat,
  $sLocalTimeFormat,
  $blOnlyDate 
)
protected

sets default formatted value

Parameters
object$oObjectdate field object
string$sDatepreferred date
string$sLocalDateFormatinput format
string$sLocalTimeFormatlocal format
bool$blOnlyDatemarker to format only date field (no time)
Returns
null

Definition at line 277 of file oxutilsdate.php.

oxUtilsDate::convertDBDate (   $oObject,
  $blToTimeStamp = false 
)

Bidirectional converter for date field

Parameters
object$oObjectoxField type object that keeps db field info
bool$blToTimeStampif true - converts value to database compatible timestamp value
Returns
string

Definition at line 261 of file oxutilsdate.php.

oxUtilsDate::convertDBDateTime (   $oObject,
  $blToTimeStamp = false,
  $blOnlyDate = false 
)

Bidirectional converter for date/datetime field

Parameters
object$oObjectdata field object
bool$blToTimeStampset TRUE to format MySQL compatible value
bool$blOnlyDateset TRUE to format "date" type field
Returns
string

Definition at line 81 of file oxutilsdate.php.

oxUtilsDate::convertDBTimestamp (   $oObject,
  $blToTimeStamp = false 
)

Bidirectional converter for timestamp field

Parameters
object$oObjectoxField type object that keeps db field info
bool$blToTimeStampif true - converts value to database compatible timestamp value
Returns
string

Definition at line 207 of file oxutilsdate.php.

oxUtilsDate::formatDBDate (   $sDBDateIn,
  $blForceEnglishRet = false 
)

Format date to user defined format.

Parameters
string$sDBDateInDate to reformat
bool$blForceEnglishRetForce to return primary value(default false)
Returns
string

Definition at line 17 of file oxutilsdate.php.

oxUtilsDate::formTime (   $sTime = 'now',
  $sTime2 = null 
)

Form time

Parameters
string$sTimetime to create timestamp.
string$sTime2hours, minutes and seconds to update created timestamp.
Returns
int formed (modified according timezone) time

Definition at line 547 of file oxutilsdate.php.

oxUtilsDate::german2English (   $sDate)

Reformats and returns German date string to English.

Parameters
string$sDateGerman format date string
Returns
string

Definition at line 611 of file oxutilsdate.php.

oxUtilsDate::getTime ( )

Returns time according shop timezone configuration. Configures in Admin -> Main menu -> Core Settings -> General

Returns
int current (modified according timezone) time

Definition at line 534 of file oxutilsdate.php.

oxUtilsDate::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.

Parameters
int$iFirstWeekDayif set formats with U, otherwise with W ($myConfig->getConfigParam( 'iFirstWeekDay' ))
string$sTimestamptimestamp, default is null (returns current week number);
string$sFormatcalculation format ( "%U" or "%w"), default is null (returns "%W" or defined in admin ).
Returns
int

Definition at line 589 of file oxutilsdate.php.

oxUtilsDate::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.

Parameters
array$sDatedate or date time string
Returns
bool

Definition at line 634 of file oxutilsdate.php.

oxUtilsDate::shiftServerTime (   $iTime)

Shift time if needed by configured timezone.

Parameters
int$iTime
Returns
int

Definition at line 569 of file oxutilsdate.php.


The documentation for this class was generated from the following file: