\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() : int

Convert the current object to a unix timestamp

Returns

int

to_dbformat()

to_dbformat() : string

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

Returns

string

day()

day() : int

Return the day of this object

Returns

int

set_day()

set_day(int $d) : int

Set the day of this object

Parameters

int $d

Returns

int

month()

month() : int

Get the month of this object

Returns

int

set_month()

set_month(int $m)

Set the month of this object

Parameters

int $m

year()

year() : int

Get the year of this object

Returns

int

set_year()

set_year(int $y)

Set the year of this object

Parameters

int $y

hour()

hour() : int

Get the hour of this object

Returns

int

set_hour()

set_hour(int $h)

Set the hour of this object

Parameters

int $h

minutes()

minutes() : int

Get the minutes of this object

Returns

int

set_minutes()

set_minutes(int $m)

Set the minutes of this object

Parameters

int $m

seconds()

seconds() : int

Get the seconds of this object

Returns

int

set_seconds()

set_seconds(int $s)

Set the seconds of this object

Parameters

int $s

set_time()

set_time(int $h, int $m)

Set the time of this object

Parameters

int $h
int $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