expDateTime

define

"BASE" "../../.."

package

Subsystems

Methods

exdoc Looks at a start and end time and figures out how many seconds elapsed since between the earlier timestamp and the later timestamp. It doesn't matter if the bigger argument is specified first or not. Returns the number of seconds between $time_a and $time_b

duration(integer $time_a, integer $time_b, boolean $iso8601 = false) : array
static
node

Subsystems:expDateTime

Arguments

$time_a

integer

The first timestamp

$time_b

integer

The second timestamp

$iso8601

boolean

return duration as an iso8601 string

Response

array

exdoc Looks at a timestamp and returns another timestamp representing 11:59:59 pm of the same day.

endOfDayTimestamp(integer $timestamp) : integer
static
node

Subsystems:expDateTime

Arguments

$timestamp

integer

The timestamp to check.

Response

integer

exdoc Looks at a timestamp and returns the date of the last day. For instance, if the passed timestamp was in January, this function would return 31. Leap year is taken into account.

endOfMonthDay(integer $timestamp) : integer
static
node

Subsystems:expDateTime

Arguments

$timestamp

integer

The timestamp to check.

Response

integer

exdoc Given a timestamp, this function will calculate another timestamp that represents the end of the month that the passed timestamp falls into. For instance, passing a timestamp representing January 25th 1984 would return a timestamp representing January 31st 1984, at 11:59pm.

endOfMonthTimestamp(integer $timestamp) : integer
static
node

Subsystems:expDateTime

Arguments

$timestamp

integer

The original timestamp to use when calculating.

Response

integer

exdoc Looks at a timestamp and returns another timestamp representing 12:00:01 am of the DISPLAY_START_OF_WEEK day of the same week.

endOfWeekTimestamp(integer $timestamp) : integer
static
node

Subsystems:expDateTime

Arguments

$timestamp

integer

The timestamp to check.

Response

integer

exdoc Given a timestamp, this function will calculate another timestamp that represents the end of the year that the passed timestamp falls into. For instance, passing a timestamp representing January 25th 1984 would return a timestamp representing December 31st 1984, at 11:59pm.

endOfYearTimestamp(integer $timestamp) : integer
static
node

Subsystems:expDateTime

Arguments

$timestamp

integer

The original timestamp to use when calculating.

Response

integer

Return a date in the preferred format

format_date( $timestamp, string $format = DISPLAY_DATE_FORMAT) : string
static

Arguments

$timestamp

$format

string

Response

string

is_date

is_date( $str) 
static

Arguments

$str

exdoc Adapted from calendar module's minical view to be more modular.

monthlyDaysTimestamp(null $time = null) : array
static

Arguments

$time

null

Response

array

exdoc

monthsDropdown( $controlName,  $default_month) : string
static
state

UNDOCUMENTED

node

To Be Deprecated

Arguments

$controlName

$default_month

Response

string

exdoc Find all of the dates that fall within the daily recurrence criteria.

recurringDailyDates(integer $start, integer $end, integer $freq) : array
static

This is the simplest form of recurrence, events are spaced a given number of days apart.

node

Subsystems:expDateTime

Arguments

$start

integer

The start of the recurrence range

$end

integer

The end of the recurrence range

$freq

integer

Frequency of recurrence - 2 means every 2 days, and 1 means every day.

Response

array

exdoc Finds all of the dates that fall within the monthly recurrence criteria and within the $start to $end timestamp range. Monthly recurrence can be done on a specific date (the 14th of the month) or on a specific weekday / offset pair (the third sunday of the month).

recurringMonthlyDates(integer $start, integer $end, integer $freq, boolean $by_day = false) : array
static
node

Subsystems:expDateTime

Arguments

$start

integer

The start of the recurrence range

$end

integer

The end of the recurrence range

$freq

integer

Monthly frequency - 1 means every month, 2 means every other month, etc.

$by_day

boolean

Whether or not to recur by the weekday and week offset (in case of true), or by the date (in case of false).

Response

array

exdoc Finds all of the dates that fall within the weekly recurrence criteria (namely, which weekdays) and within the $start to $end timestamp range.

recurringWeeklyDates(integer $start, integer $end, integer $freq, array $days) : array
static

For a technical discussion of this function and the mathematics involved, please see the sdk/analysis/subsystems/datetime.txt file.

node

Subsystems:expDateTime

Arguments

$start

integer

The start of the recurrence range

$end

integer

The end of the recurrence range

$freq

integer

Weekly frequency - 1 means every week, 2 means every other week, etc.

$days

array

The weekdays (in integer notation, 0 = Sunday, etc.) that should be matched. A MWF recurrence rotation would contain the values 1,3 and 5.

Response

array

exdoc Finds all of the dates that fall within the yearly recurrence criteria (similar to monthly) and within the $start to $end timestamp range.

recurringYearlyDates(integer $start, integer $end, integer $freq) : array
static

Unlike monthly recurrence, yearly cannot do recurrence like 'the 17th sunday of the year'.

node

Subsystems:expDateTime

Arguments

$start

integer

The start of the recurrence range

$end

integer

The end of the recurrence range

$freq

integer

Yearly frequency - 1 means every year, 2 means every other year, etc.

Response

array

Returns date as a relative phrase (2 days ago, etc.

relativeDate( $posted_date) : string
static

.)

Arguments

$posted_date

Response

string

Function to check if dates are same day

sameDay( $date1,  $date2) : boolean
static

Arguments

$date1

$date2

Response

boolean

exdoc Looks at a timestamp and returns another timestamp representing 12:00:01 am of the same day.

startOfDayTimestamp(integer $timestamp) : integer
static
node

Subsystems:expDateTime

Arguments

$timestamp

integer

The timestamp to check.

Response

integer

exdoc Given a timestamp, this function will calculate another timestamp that represents the beginning of the month that the passed timestamp falls into. For instance, passing a timestamp representing January 25th 1984 would return a timestamp representing January 1st 1984, at 12:00am.

startOfMonthTimestamp(integer $timestamp) : integer
static
node

Subsystems:expDateTime

Arguments

$timestamp

integer

The original timestamp to use when calculating.

Response

integer

exdoc Looks at a timestamp and returns another timestamp representing 12:00:01 am of the DISPLAY_START_OF_WEEK day of the same week.

startOfWeekTimestamp(integer $timestamp) : integer
static
node

Subsystems:expDateTime

Arguments

$timestamp

integer

The timestamp to check.

Response

integer

exdoc Given a timestamp, this function will calculate another timestamp that represents the beginning of the year that the passed timestamp falls into. For instance, passing a timestamp representing January 25th 1984 would return a timestamp representing January 1st 1984, at 12:00am.

startOfYearTimestamp(integer $timestamp) : integer
static
node

Subsystems:expDateTime

Arguments

$timestamp

integer

The original timestamp to use when calculating.

Response

integer