DateTime
class DateTime (View source)
Methods
Takes a "field" and grabs all the corresponding disparate fields from $_POST and translates into a timestamp.
Creates form fields and JavaScript calendar includes for a particular item (date/time string representations will be converted from the user system-zone to the time-zone).
Choose an array value nearest to a specified value.
Details
DateTime|string|null
translate(string $field, array $arr = null, bool $asDateTime = false)
Takes a "field" and grabs all the corresponding disparate fields from $_POST and translates into a timestamp.
If $field has both date and time, the resulting value will be converted from the user timezone to the system timezone. If $field has only date and not time, no timezone conversion will occur.
string
datetime(string $field, DateTime|string $value = null, bool $includeActivation = false, bool $calendarAutoStart = true, string $classes = null, int $timeResolution = 60, array $datePickerOptions = array())
Creates form fields and JavaScript calendar includes for a particular item (date/time string representations will be converted from the user system-zone to the time-zone).
string
date(string $field, DateTime|string $value = null, bool $calendarAutoStart = true, array $datePickerOptions = array())
Creates form fields and JavaScript calendar includes for a particular item but includes only calendar controls (no time, so no time-zone conversions will be applied).
protected int
selectNearestValue(array $values, int $wantedValue)
Choose an array value nearest to a specified value.
Useful when we work with time resolutions.