This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation

Class Concrete5_Helper_Date

Functions useful functions for working with dates.

Direct known subclasses

DateHelper

Package: Helpers
Category: Concrete
Copyright: Copyright (c) 2003-2008 Concrete5. (http://www.concrete5.org)
License: MIT License
Author: Andrew Embler andrew@concrete5.org
Located at core/helpers/date.php

Methods summary

public string
# getLocalDateTime( string $systemDateTime = 'now', string $mask = NULL )

Gets the date time for the local time zone/area if user timezones are enabled, if not returns system datetime

public string
# getSystemDateTime( string $userDateTime = 'now', string $mask = NULL )

Converts a user entered datetime to the system datetime

public string
# dateTimeFormatLocal( object & $datetime, string $mask )

Gets the localized date according to a specific mask

public string
# date( string $mask, integer $timestamp = false )

Subsitute for the native date() function that adds localized date support This uses Zend's Date Object http://framework.zend.com/manual/en/zend.date.constants.html#zend.date.constants.phpformats

public array
# getTimezones( )

Returns a keyed array of timezone identifiers see: http://www.php.net/datetimezone.listidentifiers.php

public string
# timeSince( integer $posttime, boolean $precise = false )

Describe the difference in time between now and a date/time in the past. If the date/time is in the future or if it's more than one year old, you'll get the date representation of $posttime

public string
# describeInterval( integer $diff, boolean $precise = false )

Returns the localized representation of a time interval specified as seconds.

public Zend_Date|null
# toZendDate( string|DateTime|Zend_Date|integer $value = 'now', string $timezone = 'system' )

Convert a date to a Zend_Date instance.

public string
# getTimezone( string $for )

Returns the current timezone.

public integer|null
# getDeltaDays( mixed $from, mixed $to, string $timezone = 'user' )

Returns the difference in days between to dates.

public string
# formatDate( mixed $value = 'now', boolean $longDate = false, string $timezone = 'user' )

Render the date part of a date/time as a localized string

public string
# formatTime( mixed $value = 'now', boolean $withSeconds = false, string $timezone = 'user' )

Render the time part of a date/time as a localized string

public string
# formatDateTime( mixed $value = 'now', boolean $longDate = false, boolean $withSeconds = false, string $timezone = 'user' )

Render both the date and time parts of a date/time as a localized string

public string
# formatPrettyDate( mixed $value, boolean $longDate = false, string $timezone = 'user' )

Render the date part of a date/time as a localized string. If the day is yesterday we'll print 'Yesterday' (the same for today, tomorrow)

public string
# formatPrettyDateTime( mixed $value, boolean $longDate = false, boolean $withSeconds = false, string $timezone = 'user' )

Render both the date and time parts of a date/time as a localized string. If the day is yesterday we'll print 'Yesterday' (the same for today, tomorrow)

public string
# formatCustom( string $format, mixed $value = 'now', string $timezone = 'user' )

Render a date/time as a localized string, by specifying a custom format

public string
# formatSpecial( string $formatName, mixed $value = 'now', string $timezone = 'user' )

Render a date/time as a localized string, by specifying the name of one of the format accepted by getSpecialFormat

public string
# getSpecialFormat( string $formatName )

Return the date/time format for special items

public string
# getJQueryUIDatePickerFormat( )

Returns the format string for the jQueryUI DatePicker widget The format corresponds to the one used by DateHelper->formatDate($value, false)