category OSS
package OSS_Date
copyright Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland
license New BSD License

 Methods

Parse a date in a given format to an array of (day, month, year)

dateSplit(string $string, int $format) : array
Static

Parameters

$string

string

$format

int

Returns

array

Returns array of date format codes.

getDateFormatKeys() : array
Static

ie. returns the keys of self::$DATE_FORMATS

Returns

array

Returns an associative array of date formats.

getDateFormats() : array
Static

I.e. returns self::$DATE_FORMATS

Returns

array

Returns the JQuery date picker format for a given format code or fallback to default.

getDatepickerFormat(int $code, int $default) : string | bool
Static

Parameters

$code

int

The format code

$default

int

The default value if $code does not exist

Returns

stringbool

Returns the format for a given format code or fallback to default.

getFormat(int $code, int $default) : string | bool
Static

Parameters

$code

int

The format code

$default

int

The default value if $code does not exist

Returns

stringbool

Returns the PHP date() format for a given format code or fallback to default.

getPhpFormat(int $code, int $default) : string | bool
Static

Parameters

$code

int

The format code

$default

int

The default value if $code does not exist

Returns

stringbool

Parse a string in a given format to a UNIX timestamp

getTimestamp(string $string, int $format) : int
Static

Parameters

$string

string

$format

int

Returns

int

 Properties

 

Date formats for data picker

$DATEPICKER_FORMATS : array
 

Date formats

$DATE_FORMATS : array
 

Date formats for PHP

$PHP_FORMATS : array

 Constants

 

DF_AMERICAN

DF_AMERICAN 
 

DF_COMPACT

DF_COMPACT 
 

DF_COMPUTER

DF_COMPUTER 
 

DF_EUROPEAN

DF_EUROPEAN 
 

DF_REVERSE

DF_REVERSE