Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Private Attributes

oxUtilsDate Class Reference

Inheritance diagram for oxUtilsDate:
Collaboration diagram for oxUtilsDate:

List of all members.

Public Member Functions

 formatDBDate ($sDBDateIn, $blForceEnglishRet=false)
 convertDBDateTime ($oObject, $blToTimeStamp=false, $blOnlyDate=false)
 convertDBTimestamp ($oObject, $blToTimeStamp=false)
 convertDBDate ($oObject, $blToTimeStamp=false)
 getTime ()
 getWeekNumber ($iFirstWeekDay, $sTimestamp=null, $sFormat=null)
 german2English ($sDate)
 isEmptyDate ($sDate)

Static Public Member Functions

static getInstance ()

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)

Static Private Attributes

static $_instance = 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 355 of file oxutilsdate.php.

oxUtilsDate._defaultTimePattern (  )  [protected]

sets default time pattern

Returns:
array

Definition at line 370 of file oxutilsdate.php.

oxUtilsDate._defineAndCheckDefaultDateValues ( blToTimeStamp  )  [protected]

defines and checks default date values

Parameters:
bool $blToTimeStamp marker how to format
Returns:
string

Definition at line 339 of file oxutilsdate.php.

oxUtilsDate._defineAndCheckDefaultTimeValues ( blToTimeStamp  )  [protected]

defines and checks default time values

Parameters:
bool $blToTimeStamp -
Returns:
string

Definition at line 321 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 430 of file oxutilsdate.php.

oxUtilsDate._formatCorrectTimeValue ( oObject,
sDateFormat,
sTimeFormat,
aDateMatches,
aTimeMatches,
aTFields,
aDFields 
) [protected]

Formatting correct time value

Parameters:
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
Returns:
null

Definition at line 508 of file oxutilsdate.php.

oxUtilsDate._processDate ( aTime,
aDate,
blGerman,
sFormat 
) [protected]

Processes amd formats date / time.

Parameters:
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
Returns:
string formatted string

Definition at line 601 of file oxutilsdate.php.

oxUtilsDate._regexp2ValidateDateInput (  )  [protected]

regular expressions to validate date input

Returns:
array

Definition at line 385 of file oxutilsdate.php.

oxUtilsDate._regexp2ValidateTimeInput (  )  [protected]

regular expressions to validate time input

Returns:
array

Definition at line 400 of file oxutilsdate.php.

oxUtilsDate._setDate ( oObject,
sDateFormat,
aDFields,
aDateMatches 
) [protected]

sets date

Parameters:
object $oObject date field object
string $sDateFormat date format
array $aDFields days
array $aDateMatches new date as array (month, year)
Returns:
null

Definition at line 479 of file oxutilsdate.php.

oxUtilsDate._setDefaultDateTimeValue ( oObject,
sLocalDateFormat,
sLocalTimeFormat,
blOnlyDate 
) [protected]

Sets default date time value

Parameters:
object $oObject date field object
string $sLocalDateFormat input format
string $sLocalTimeFormat local format
bool $blOnlyDate marker to format only date field (no time)
Returns:
null

Definition at line 450 of file oxutilsdate.php.

oxUtilsDate._setDefaultFormatedValue ( oObject,
sDate,
sLocalDateFormat,
sLocalTimeFormat,
blOnlyDate 
) [protected]

sets default formatted value

Parameters:
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)
Returns:
null

Definition at line 285 of file oxutilsdate.php.

oxUtilsDate.convertDBDate ( oObject,
blToTimeStamp = false 
)

Bidirectional converter for date field

Parameters:
object $oObject oxField type object that keeps db field info
bool $blToTimeStamp if true - converts value to database compatible timestamp value
Returns:
string

Definition at line 269 of file oxutilsdate.php.

oxUtilsDate.convertDBDateTime ( oObject,
blToTimeStamp = false,
blOnlyDate = false 
)

Bidirectional converter for date/datetime field

Parameters:
object $oObject data field object
bool $blToTimeStamp set TRUE to format MySQL compatible value
bool $blOnlyDate set TRUE to format "date" type field
Returns:
string

Definition at line 99 of file oxutilsdate.php.

oxUtilsDate.convertDBTimestamp ( oObject,
blToTimeStamp = false 
)

Bidirectional converter for timestamp field

Parameters:
object $oObject oxField type object that keeps db field info
bool $blToTimeStamp if true - converts value to database compatible timestamp value
Returns:
string

Definition at line 219 of file oxutilsdate.php.

oxUtilsDate.formatDBDate ( sDBDateIn,
blForceEnglishRet = false 
)

Format date to user defined format.

Parameters:
string $sDBDateIn Date to reformat
bool $blForceEnglishRet Force to return primary value(default false)
Returns:
string

Definition at line 35 of file oxutilsdate.php.

oxUtilsDate.german2English ( sDate  ) 

Reformats and returns German date string to English.

Parameters:
string $sDate German format date string
Returns:
string

Definition at line 576 of file oxutilsdate.php.

static oxUtilsDate.getInstance (  )  [static]

Returns object instance

Deprecated:
since v5.0 (2012-08-10); Please use oxRegistry.get("oxUtilsDate") instead.
Returns:
oxUtilsDate

Definition at line 22 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 $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 ).
Returns:
int

Definition at line 555 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 $sDate date or date time string
Returns:
bool

Definition at line 618 of file oxutilsdate.php.


Member Data Documentation

oxUtilsDate.$_instance = null [static, private]

Definition at line 13 of file oxutilsdate.php.


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