\cge_date

A Class to represent and operate on a date

Summary

Methods
Properties
Constants
__construct()
to_timestamp()
to_dbformat()
day()
set_day()
month()
set_month()
year()
set_year()
hour()
set_hour()
minutes()
set_minutes()
seconds()
set_seconds()
set_time()
set_time_from_str()
get_rfc_date()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(mixed  $time = '') 

Constructor

Parameters

mixed $time

A mixed value. If an integer value is passed, it is assumed to be a unix timestamp. If a string is passed, then attempts are made to convert the string into a unix timestamp.

to_timestamp()

to_timestamp() : integer

Convert the current object to a unix timestamp

Returns

integer

to_dbformat()

to_dbformat() : string

convert the current object to a format suitable for saving in the database

Returns

string

day()

day() : integer

Return the day of this object

Returns

integer

set_day()

set_day(integer  $d) : integer

Set the day of this object

Parameters

integer $d

Returns

integer

month()

month() : integer

Get the month of this object

Returns

integer

set_month()

set_month(integer  $m) 

Set the month of this object

Parameters

integer $m

year()

year() : integer

Get the year of this object

Returns

integer

set_year()

set_year(integer  $y) 

Set the year of this object

Parameters

integer $y

hour()

hour() : integer

Get the hour of this object

Returns

integer

set_hour()

set_hour(integer  $h) 

Set the hour of this object

Parameters

integer $h

minutes()

minutes() : integer

Get the minutes of this object

Returns

integer

set_minutes()

set_minutes(integer  $m) 

Set the minutes of this object

Parameters

integer $m

seconds()

seconds() : integer

Get the seconds of this object

Returns

integer

set_seconds()

set_seconds(integer  $s) 

Set the seconds of this object

Parameters

integer $s

set_time()

set_time(integer  $h, integer  $m) 

Set the time of this object

Parameters

integer $h
integer $m

set_time_from_str()

set_time_from_str(string  $time_str) 

Given a time string (in the format H:M, adjust the time of this object appropriately

Parameters

string $time_str

get_rfc_date()

get_rfc_date() : string

Get the current date from this object in rfc format

Returns

string