Campustream 1.0
A social network MQP for WPI
date Class Reference

Static Public Member Functions

static relative_time ($timestamp)

Data Fields

const TIME_OFFSET = 0
const ONE_MIN = 60
const TWO_MIN = 120
const ONE_HOUR = 3600
const TWO_HOUR = 7200
const ONE_DAY = 86400
const TWO_DAY = 172800
const DISPLAY_ONE_MIN = 'less than a minute ago'
const DISPLAY_TWO_MIN = 'about a minute ago'
const DISPLAY_ONE_HOUR = 'about %d minutes ago'
const DISPLAY_TWO_HOUR = 'about an hour ago'
const DISPLAY_ONE_DAY = 'about %d hours ago'
const DISPLAY_TWO_DAY = '1 day ago'
const DISPLAY_OTHER = '%d days ago'
const DISPLAY_FUTURE_ONE_MIN = 'in a minute'
const DISPLAY_FUTURE_TWO_MIN = 'in a few minutes'
const DISPLAY_FUTURE_ONE_HOUR = 'in about %d minutes'
const DISPLAY_FUTURE_TWO_HOUR = 'in about an hour'
const DISPLAY_FUTURE_ONE_DAY = 'in about %d hours'
const DISPLAY_FUTURE_TWO_DAY = 'in about 1 day'
const DISPLAY_FUTURE_OTHER = 'in %d days'

Detailed Description

Date helper class used throughout the site.

Definition at line 6 of file date.php.


Member Function Documentation

static relative_time ( timestamp) [static]

Given a timestamp, figures out the relative time between now and then

Parameters:
int | string$timestampthe timestamp to compare now with
Returns:
a string of the relative time between the two timestamps

Definition at line 41 of file date.php.


Field Documentation

const DISPLAY_FUTURE_ONE_DAY = 'in about %d hours'

Definition at line 30 of file date.php.

const DISPLAY_FUTURE_ONE_HOUR = 'in about %d minutes'

Definition at line 28 of file date.php.

const DISPLAY_FUTURE_ONE_MIN = 'in a minute'

Definition at line 26 of file date.php.

const DISPLAY_FUTURE_OTHER = 'in %d days'

Definition at line 32 of file date.php.

const DISPLAY_FUTURE_TWO_DAY = 'in about 1 day'

Definition at line 31 of file date.php.

const DISPLAY_FUTURE_TWO_HOUR = 'in about an hour'

Definition at line 29 of file date.php.

const DISPLAY_FUTURE_TWO_MIN = 'in a few minutes'

Definition at line 27 of file date.php.

const DISPLAY_ONE_DAY = 'about %d hours ago'

Definition at line 21 of file date.php.

const DISPLAY_ONE_HOUR = 'about %d minutes ago'

Definition at line 19 of file date.php.

const DISPLAY_ONE_MIN = 'less than a minute ago'

Definition at line 17 of file date.php.

const DISPLAY_OTHER = '%d days ago'

Definition at line 23 of file date.php.

const DISPLAY_TWO_DAY = '1 day ago'

Definition at line 22 of file date.php.

const DISPLAY_TWO_HOUR = 'about an hour ago'

Definition at line 20 of file date.php.

const DISPLAY_TWO_MIN = 'about a minute ago'

Definition at line 18 of file date.php.

const ONE_DAY = 86400

Definition at line 14 of file date.php.

const ONE_HOUR = 3600

Definition at line 12 of file date.php.

const ONE_MIN = 60

Definition at line 10 of file date.php.

const TIME_OFFSET = 0

Definition at line 8 of file date.php.

const TWO_DAY = 172800

Definition at line 15 of file date.php.

const TWO_HOUR = 7200

Definition at line 13 of file date.php.

const TWO_MIN = 120

Definition at line 11 of file date.php.


The documentation for this class was generated from the following file: