# \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

File
  lib/class.cge_date.php
Class hierarchy
  \cge_date

## Tags

deprecated |
todo |

## 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.

#

## Tags

todo |

### to_timestamp()

    to_timestamp() : int

Convert the current object to a unix timestamp

#### Returns

int

#

## Tags

todo |

### to_dbformat()

    to_dbformat() : string

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

#### Returns

string

#

## Tags

todo |

### day()

    day() : int

Return the day of this object

#### Returns

int

#

## Tags

todo |

### set_day()

    set_day(int $d) : int

Set the day of this object

#### Parameters

int | $d |

#### Returns

int

#

## Tags

todo |

### month()

    month() : int

Get the month of this object

#### Returns

int

#

## Tags

todo |

### set_month()

    set_month(int $m)

Set the month of this object

#### Parameters

int | $m |

#

## Tags

todo |

### year()

    year() : int

Get the year of this object

#### Returns

int

#

## Tags

todo |

### set_year()

    set_year(int $y)

Set the year of this object

#### Parameters

int | $y |

#

## Tags

todo |

### hour()

    hour() : int

Get the hour of this object

#### Returns

int

#

## Tags

todo |

### set_hour()

    set_hour(int $h)

Set the hour of this object

#### Parameters

int | $h |

#

## Tags

todo |

### minutes()

    minutes() : int

Get the minutes of this object

#### Returns

int

#

## Tags

todo |

### set_minutes()

    set_minutes(int $m)

Set the minutes of this object

#### Parameters

int | $m |

#

## Tags

todo |

### seconds()

    seconds() : int

Get the seconds of this object

#### Returns

int

#

## Tags

todo |

### set_seconds()

    set_seconds(int $s)

Set the seconds of this object

#### Parameters

int | $s |

#

## Tags

todo |

### set_time()

    set_time(int $h, int $m)

Set the time of this object

#### Parameters

int | $h |
int | $m |

#

## Tags

todo |

### 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 |

#

## Tags

todo |

### get_rfc_date()

    get_rfc_date() : string

Get the current date from this object in rfc format

#### Returns

string

#

## Tags

todo |

### class.cge_date.php