PHP Date Class Documentation


Constructor

Date(String $str)

Date Class Constructor

String $str A string containing a valid datetime format.
Supported Formats: dd mmm yyyy, mmm dd yyyy, mm/dd/yyy, yyyy/mm/dd, dd/mm/yyyy. Also supports the - delimitor. e.g mm-dd-yyyy Time: hh:mm:ss.

Functions

setDate(String $str) : void

Sets the Date/Time for the Date object

String $str A string containing a valid datetime in the format.

getTimestamp(String $str) : int

Returns an ADODB Date timestamp

String $str Supported datetime format.

format(String $fmt, String $dtTime) : string

Format and returns a date string. This function used the PHP date() format.

String $fmt Format in which the datetime value should be rendered.
Mixed $dtTime A valid datetime string or ADODB Date timestamp

parse(String $str) : array

Parses a datetime string and returns an array containing the date parts otherwise false. Works with date values returned from MSSQL,MySQL and other databases.

String $str Supported datetime string input format