HOW THE QUIZ WORKS:
Clicking the ‘randomize’ button situated above the reference table generates a new table whereby the function descriptions, function syntaxes, and function return values are randomized. The quiz involves matching the function descriptions, function syntaxes, and function return values to the correct function name. Information relating to the randomization of table cells will be displayed for three seconds, before disappearing.
On a desktop computer, table elements are selected by left-clicking the desired table cell and holding the left click in the mouse down position for one second before releasing the left click. The text inside the table cell will turn red to indicate that the one-second mouse left-click has successfully selected a table cell. To then swap the selected table cell with the target table cell, simply repeat the one-second left mouse-click process on the target cell; the table cells will swap position. To de-select a table cell, simply repeat the one-second left mouse-click process on the original table cell.
To select a table element on a touchscreen device (mobile, tablet), simply touch the desired table cell and maintain the touch for one second before removing your finger from the screen. The text inside the table cell will turn red to indicate that the one-second touch has successfully selected a table cell. To then swap the selected table cell with the target table cell, simply repeat the one-second touch process on the target cell; the table cells will swap position. To de-select a table cell, simply repeat the one-second touch process on the original table cell.
Normal touchscreen scrolling behaviour is exhibited by the cells with a light green background; cells without a light green background will not respond to normal touchscreen scrolling. The table is positioned in such a way that the user can also initiate touchscreen scrolling by swiping to the right or left of the table.
When a row consists of the correct function name, function description, function syntax, and function return value, the background colour of the row will change from ‘transparent’ to ‘khaki’; this provides visual feedback that the row is complete.
Once the entire table is complete, a paragraph of feedback will congratulate the user and provide the following information: date and time of quiz commencement; date and time of quiz completion; and the length of time it took the user to complete the quiz.
VIEWPORT OPTIONS:



PURPOSE:
This webpage serves two purposes:
- It provides a reference table for the PHP date/time functions, with information extracted and condensed from w3schools.com and php.net.
- It enables users to complete a quiz related to the PHP date/time functions.
USAGE:
For each date/time function there are four table cells of information: the function name; the function description; the function syntax; and the function return value. There are three layouts available – ‘mobile‘, ‘tablet‘, and ‘desktop‘.
Click the relevant button below to display the PHP date/time functions reference table, sized appropriately for the desired viewport. A ‘RANDOMIZE‘ button appears above the reference table once the viewport is selected; clicking this button facilitates the commencement of a quiz.
Click the ‘RANDOMIZE‘ button to randomize the functional descriptions, the functional syntaxes, and the functional return information.
FUNCTION NAME | FUNCTION DESCRIPTION | FUNCTION SYNTAX | FUNCTION RETURN VALUE |
---|---|---|---|
checkdate()
[Validate a Gregorian date] |
Checks the validity of the date formed by the month [1 – 12], day [within the allowed parameters for month], and year [1 – 32767] arguments. | checkdate(month, day, year); |
checkdate() : returns TRUE if each argument of date is correctly defined; otherwise it returns FALSE. |
date_add()
[Adds an amount of days, months, years, hours, minutes, and seconds to a DateTime object] |
Adds the specified DateInterval object to the specified DateTime object. | date_add(DateTime, DateInterval); |
date_add() : Returns the DateTime object for method chaining on success; FALSE on failure. |
date_create_from_format()
[Parses a time string according to a specified format] |
Returns a new DateTime object representing the date and time specified by the time string, which was formatted in the given format. | date_create_from_format(format, time, DateTimeZone [optional parameter]);
[The following characters can be used in the format parameter: d [01 – 31]); j [1 -31]; D [Mon – Sun]; l [Sunday through Saturday]; S [st, nd, rd, th]; z [day of the year, 0 – 365]; F [January – December]; M [Jan – Dec]; m [month: 01 – 12]; n [month: 1 – 12]; Y [4-digit year: 2018]; y [2-digit year representation assumed to be in the range 1970-2069 (inclusive): 18]; a and A [‘am’ or ‘pm’ (Ante Meridian, Post Meridian)]; g [hour representation: 1 – 12]; h [hour representation: 01 – 12]; G [24-hour representation: 0 – 23]; H [24-hour representation: 00 – 23]; i [minutes: 00 – 59]; s [seconds: 00 – 59]; u [microseconds – up to 6 digits]; e [timezone identifier]; O [difference to UTC in hours]; P [difference to UTC in hours:mins]; T [timezone abbreviation]; U [seconds since the Unix Epoch]; (space) [space]; # [used to prefix one of the following separator symbols]: ;,:,/,., ,,,-,(,) [e.g. ‘Y-m-d H:i:s’]; ? [a random byte]; * [random bytes until the next separator or digit]; ! [resets all fields to the Unix Epoch]; | [resets all fields to the Unix Epoch if they have not been parsed yet]; + [if present, trailing data will cause a warning rather than an error].] |
date_create_from_format() : returns a new DateTime object, representing the date and time specified by time in the given format; FALSE on failure. |
date_date_set()
[Sets the date] |
Resets the current date of the DateTime object to a different date. | date_date_set(datetime_object, year, month, day); |
date_date_set() : Returns the DateTime object for method chaining or FALSE on failure. |
date_default_timezone_get()
[Gets the default timezone used by all date/time functions in a script] |
Returns a string representing the default timezone. Prior to PHP 5.4.0 this could be achieved by reading the TZ environment variable (if non-empty) OR by querying the host OS (if this functionality was supported and permitted by the OS). In more recent versions of PHP the default timezone can be read if the timezone has been set using the date_default_timezone_set() function OR by reading the value of the date.timezone ini option (if set). If the algorithm above fails to furnish the default timezone, a value of UTC is returned as the default value. |
date_default_timezone_get(); |
date_default_timezone_get() : returns a string representing the default timezone. |
date_default_timezone_set()
[Sets the default timezone used by all date/time functions in a script] |
timezone_identifier sets the default timezone used by all date/time functions. Since PHP 5.1.0, every call to a date/time function will generate a E_NOTICE if the timezone is invalid, and/or a E_WARNING message if using the system settings or the TZ environment variable. The INI setting date.timezone can also be used to set the default timezone. |
date_default_timezone_set(timezone_identifier); |
date_default_timezone_set() : returns TRUE if timezone_identifier is valid; FALSE otherwise. |
date_diff()
[Returns the difference between two DateTime objects] |
This function returns the difference between two DateTime objects. | date_diff(datetime1, datetime2, absolute [optional parameter – specifies whether the interval should be forced to be positive]); |
date_diff() : returns a DateInterval object representing the difference between the two dates on success; FALSE on failure. |
date_format()
[Returns date formatted according to given format] |
This function returns the date formatted according to the given format. | date_format(datetime_interface, format); |
date_format() : returns the formatted date string on success, or FALSE on failure. |
date_get_last_errors()
[Returns the warnings and errors] |
This function returns an array of warnings and errors found while parsing a date/time string. | date_get_last_errors(); |
date_get_last_errors() : returns an array containing information about warnings and errors encountered while parsing a date/time string. |
DateInterval::createFromDateString()
[Sets up a DateInterval from the relative parts of the string] |
Uses the normal date parsers and sets up a DateInterval from the relative parts of the parsed time string. The DateInterval will be constructed using the relative formats supported by the parser used for strtotime() and DateTime . |
DateInterval::createFromDateString(time); |
DateInterval::createFromDateString() : returns a DateInterval from the relative parts of the parsed time string. |
DateInterval::format()
[Formats the interval] |
This function formats the interval. | DateInterval::format(format);
[The following characters (all prefixed with the % sign) can be used in the format string: % (literal %); Y (years – 01, 03); y (years – 1, 3); M (months – 01, 03); m (months – 1, 3); D (days – 01, 03); d (days – 1, 3); a (total number of days as a result of |
DateInterval::format() : returns the formatted interval. |
DateTime::setISODate() date_isodate_set() [Sets the ISO date] |
Set a date according to the ISO 8601 standard, using weeks and day offsets rather than specific dates. | Object-oriented style:DateTime::setISODate(year, week, day [optional parameter]); Procedural style: date_isodate_set(datetime_object, year, week, day [optional parameter]);
[day specifies the offset from the first day of the week; default value is 1] |
DateTime::setISODate() : returns the DateTime object for method chaining on success; FALSE on failure. |
DateTime::modify() date_modify()
[Alters the timestamp] |
Modifies the timestamp of a DateTime object by incrementing or decrementing in a format accepted by strtotime() . |
Object-oriented style:DateTime::modify(modification_string); Procedural style: date_modify(datetime_object, modification_string); |
DateTime::modify() : Returns the DateTime object for method chaining on success; FALSE on failure. |
DateTime::getOffset() date_offset_get()
[Returns the timezone offset] |
Returns the timezone offset from UTC in seconds. | Object-oriented style:DateTime::getOffset(); Procedural style: date_offset_get(DateTimeInterface_object); |
DateTime::getOffset() : returns the timezone offset in seconds from UTC on success; FALSE on failure. |
date_parse_from_format()
[Get info about given date formatted according to the specified format] |
Returns an associative array containing information about the given date. | date_parse_from_format(format, date); |
date_parse_from_format() : returns an associative array containing information about the given date. |
date_parse()
[Returns associative array with detailed info about given date] |
Returns an array containing information about the parsed date. | date_parse(date);
[date must be in a format accepted by |
date_parse() : returns an array containing information about the parsed date on success; FALSE on failure.If date is formatted incorrectly, the element ‘errors’ will contain the error messages. |
DateTime::sub() date_sub()
[Subtracts an amount of days, months, years, hours, minutes, and seconds from a DateTime object] |
Subtracts the specified DateInterval from the given DateTime. | Object-oriented style:DateTime::sub(DateInterval); Procedural style: date_sub(DateTime, DateInterval); |
DateTime::sub() : returns the DateTime object for method chaining on success; FALSE on failure. |
date_sun_info()
[Returns an array with information about sunset/sunrise and twilight begin/end] |
Returns an array with sun info, specifically: sunrise and sunset [zenith angle = 90°’35]; transit [time when sun is at its zenith]; civil_twilight_begin [zenith angle = 96°, ends at sunrise]; civil_twilight_end [zenith angle = 96°, starts at sunset]; nautical_twilight_begin [zenith angle = 102°, ends at civil_twilight_begin]; nautical_twilight_end [zenith angle = 102°, starts at civil_twilight_end]; astronomical_twilight_begin [zenith angle = 108°, ends at nautical_twilight_begin]; and astronomical_twilight_end [zenith angle = 108°, starts at nautical_twilight_end]. | date_sun_info(time, latitude, longitude); |
date_sun_info() : returns an array of elements containing information relating to sunset/sunrise and twilight begin/end on success; FALSE on failure. The values of the array elements are either UNIX timestamps, FALSE if the sun is below the respective zenith for the whole day, or TRUE if the sun is above the respective zenith for the whole day. |
date_sunrise()
[Returns time of sunrise for a given day and location] |
This function returns the sunrise time for a given day (specified as timestamp) and location. An E_NOTICE will be generated each time a call is made to a DateTime function with an invalid timezone. An E_STRICT or E_WARNING message is generated if using the system settings or the TZ environment variable. | date_sunrise(timestamp, format [optional parameter], latitude [optional parameter], longitude [optional parameter], zenith [optional parameter], gmt_offset [optional parameter]);
[format can be represented by the following values: SUNFUNCS_RET_STRING; SUNFUNCS_RET_DOUBLE; and SUNFUNCS_RET_TIMESTAMP.] |
date_sunrise() : returns the sunrise time in the specified format on success; FALSE on failure. For part of the year inside the polar circles the sun does not rise at all, which is one potential reason why this function might fail. |
date_sunset()
[Returns time of sunset for a given day and location] |
Returns the sunset time for a given day (specified as timestamp) and location. latitude and longitude default to north and east respectively; pass in a negative value for south and west. Some useful zenith values include: 90°50′ [sunset: sun becomes invisible]; 96° [civil twilight: signifies end of dusk]; 102 ° [nautical twilight: horizon ends being visible at sea]; and 108° [astronomical twilight: sun ends being the source of any illumination]. | date_sunset(timestamp, format [optional parameter], latitude [optional parameter], longitude [optional parameter], zenith [optional parameter], gmt_offset [optional parameter]);
[gmt_offset is specified in hours and is ignored if format is represented by SUNFUNCS_RET_TIMESTAMP.] |
date_sunset() : returns the sunset time in the specified format on success; FALSE on failure. For part of the year inside the polar circles the sun does not set at all, which is one potential reason why this function might fail. |
DateTime::setTime() date_time_set()
[Sets the time] |
Resets the current time of the DateTime object to a different time. | Object-oriented style:DateTime::setTime(hour, minute, second [optional parameter], microseconds [optional parameter]); Procedural style: date_time_set(DateTime_object, hour, minute, second [optional parameter], microseconds [optional parameter]);
[second and microseconds default to 0.] |
DateTime::setTime() : returns the DateTime object for method chaining on success; FALSE on failure. |
DateTime::getTimestamp() date_timestamp_get()
[Gets the Unix timestamp] |
This function gets the Unix timestamp. | Object-oriented style:DateTime::getTimestamp(); Procedural style: date_timestamp_get(DateTimeInterface_object); . |
DateTime::getTimestamp() : returns the Unix timestamp representing the date. |
DateTime::setTimestamp() date_timestamp_set()
[Sets the date and time based on an Unix timestamp] |
Sets the date and time based on a Unix timestamp. | Object-oriented style:DateTime::setTimestamp(unix_timestamp); Procedural style: date_timestamp_set(datetime_object, unix_timestamp); |
DateTime::setTimestamp() : returns the DateTime object for method chaining on success; FALSE on failure. |
DateTime::getTimezone() date_timezone_get()
[Return time zone relative to given DateTime] |
Returns the time zone relative to the given DateTime. | Object-oriented style:DateTime::getTimezone(); Procedural style: date_timezone_get(DateTimeInterface_object); |
DateTime::getTimezone() : returns a DateTimeInterface object on success; FALSE on failure. |
DateTime::setTimezone() date_timezone_set()
[Sets the time zone for the DateTime object] |
Sets the time zone for the DateTime object. | Object-oriented style:DateTime::setTimezone(timezone); Procedural style: date_timezone_set(DateTime_object, timezone); |
DateTime::setTimezone() : returns the DateTime object for method chaining on success; FALSE on failure. |
date()
[Format a local time/date] |
Returns a date string formatted according to the given format string, using the provided timestamp or the current time if no timestamp is given. The optional timestamp defaults to the value of time() . |
date(format, timestamp [optional parameter]);
[formatting options: d [day: 01 — 31]; D [3-letter day representation: Mon — Sun]; j [day: 1 — 31]; l [day: Monday — Sunday]; N [ISO-8601 day representation: 1 (Monday) — 7 (Sunday)]; S [st, nd, rd, th]; w [0 (Sunday) — 6 (Saturday)]; z [Day of year: 0 — 365]; W [ISO-8601 week number of year, starting on Monday]; F [full month name: January — December]; m [numerical month representation: 01 — 12]; M [month name: jan — dec]; n [numerical month representation: 1 -12]; t [number of days in given month: 28 – 31]; L [uppercase ‘l’ — leap year?1:0]; o [ISO-8601 week-numbering year; same value as Y except that if W belongs to the previous or next year, that year is used instead — 1999, 2003]; Y [4-digit year representation — 1999, 2003]; y [2-digit year representation — 99, 03]; a [lowercase Ante meridiem and Post meridiem]; A [uppercase Ante meridiem and Post meridiem]; B [Swatch Internet time — 000 – 999]; g [12-hour time format: 1 — 12]; G [24-hour time format: 0 — 23]; h [12-hour time format: 01 – 12]; H [24-hour time format: 00 – 23]; i [minutes — 00 – 59]; s [seconds – 00 – 59]; u [microseconds: |
date() : returns a formatted date string. If a non-numeric value is used for timestamp, FALSE is returned and an E_WARNING level error is emitted. |
getdate()
[Get date/time information] |
Returns an associative array containing the date information of timestamp or the current local time if timestamp is not provided. | getdate(timestamp [optional parameter defaulting to value of time() ]); |
getdate() : returns an associative array containing date information relating to timestamp. Elements comprise: ‘seconds’ [0-59]; ‘minutes’ [0-59]; ‘hours’ [0-23]; ‘mday’ [1-31]; ‘wday’ [0 (Sunday) – 6 (Saturday)]; ‘mon’ [1-12]; ‘year’ [1999, 2003]; ‘yday’ [0-365]; ‘weekday’ [Sunday — Saturday]; ‘month’ [January — December]; ‘0’ [seconds since the Unix Epoch: system-dependent, typically from -2147483648 — 2147483647]. |
gettimeofday()
[Get current time] |
An interface call to gettimeofday(2) ; it returns the time of day information-related associative array returned from the system call. |
gettimeofday(return_float [optional boolean parameter – if ‘true’ then a float is returned instead of an associative array]); |
gettimeofday() : if return_float is true then a float is returned. Otherwise, an associative array is returned, comprising the following time of day elements: ‘secs’ [seconds since the Unix Epoch]; ‘usec’ [microseconds]; ‘minuteswest’ [minutes west of Greenwich]; and ‘dsttime’ [type of dst correction]. |
gmdate()
[Format a GMT/UTC date/time] |
Identical to the date() function, except that the time returned is GMT. |
gmdate(format, timestamp [optional parameter, defaulting to value of time() ]);
[The valid range of timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT.] |
gmdate() : returns a formatted date string. If a non-numeric value is used for timestamp, FALSE is returned and an E_WARNING level error is emitted. |
gmmktime()
[Get Unix timestamp for a GMT date] |
Identical to mktime() except that the passed parameters represents a GMT date. Returns the Unix timestamp for the created date. |
gmmktime(hour, minute, second, month, day, year, is_dst);
[All parameters above are optional. Defaults: hour — |
gmmktime() : returns an integer Unix timestamp. |
gmstrftime()
[Format a UTC/GMT time/date according to locale settings] |
Behaves the same as strftime() except that the formatted time string returned is GMT. |
gmstrftime(format, timestamp [optional parameter, defaulting to the value of time() ]); |
gmstrftime() : returns a string formatted according to the given format using timestamp if given, or the value of time() . Month and weekday names and other language-dependent strings respect the current locale set with setlocale() . |
idate()
[Format a local time/date as integer] |
Returns a number formatted according to format using the timestamp parameter if present, or the current local time() if not. idate() accepts just one char in the format parameter. |
idate(format, timestamp [optional parameter]);
[The following characters can be used as the format string: B; d; h; H; i; I; l; m; s; t; U; w; W; y; Y; z; and Z. Please cross-reference the format codes used in the |
idate() : always returns an integer. Since integers cannot start with 0, this function may return fewer digits than initially expected. Every call to a date/time function will generate an E_NOTICE if the timezone is not valid, and/or a E_STRICT or E_WARNING message if using the system settings or the TZ environment variable. |
localtime()
[Get the local time] |
Returns an array of local time-related elements. If is_associative is set to true, the associative array contains all the different elements of the structure returned by the C function call to localtime . The different keys of the associative array are: ‘tm_sec’ (0 — 59); ‘tm_min’ (0 — 59); ‘tm_hour’ (0 — 23); ‘tm_mday’ (1 — 31); ‘tm_mon’ (0 [Jan] — 11 [Dec]); ‘tm_year’ (years since 1900); ‘tm_wday’ (0 [Sun] — 6 [Sat]); ‘tm_yday’ (0 — 365); ‘isdst’ (?1:0:-) [DST? positive if yes:0 if no:negative if unknown]. |
localtime(timestamp [optional parameter, defaulting to value of time() ], is_associative [optional parameter, with a default value of false]); . |
localtime() : if is_associative is set to false or not provided, a numerically-indexed array is returned. If is_associative is set to true, an associative array is returned. |
microtime()
[Return current Unix timestamp with microseconds] |
Returns the current Unix timestamp with microseconds. This function only works on operating systems that support the gettimeofday() system call. |
microtime(get_as_float [optional parameter, with a default value of false]); |
microtime() : if get_as_float is false [default] then a string is returned in the form ‘msec sec‘, where sec is the number of seconds since the Unix Epoch and msec measures microseconds that have elapsed since sec. If get_as_float is true then a float is returned that represents the number of seconds since the Unix Epoch, accurate to the nearest microsecond. |
mktime()
[Get Unix timestamp for a date] |
Returns the Unix timestamp corresponding to the arguments given. This timestamp is a long integer and represents the number of seconds between the Unix Epoch and the time specified. | mktime(hour, minute, second, month, day, year, is_dst);
[All the above parameters are optional. Default values: hour = |
mktime() : returns the Unix timestamp of the arguments given. If invalid arguments are given, FALSE is returned. |
strftime()
[Format a local time/date according to locale settings] |
Formats the time and/or date according to locale settings, based on format_string. Month, weekday names, and other language-dependent strings respect the current locale set with setlocale() . Conversion specifiers that are not supported by your C library will not be supported by strftime() . Furthermore, platforms that do not support negative timestamps will be limited to a date range that starts no earlier than the Unix Epoch. |
strftime(format_string, timestamp [optional parameter, with a default value of time() ]);
[The maximum length of format_string is 1023 characters. Valid characters for this parameter are: %a [‘Sun’ — ‘Sat’]; %A [‘Sunday’ — ‘Saturday’]; %d [’01’ — ’31’]; %e [‘1′ — ’31’]; %j [‘001’ — ‘366’]; %u [‘1’ (Monday) — ‘7’ (Sunday)]; %w [‘0’ (Sunday) — ‘6’ (Saturday)]; %U [week number of year; Sunday as first day of the week]; %V [week number of year; Monday as start of week; first week has 4+ weekdays]; %W [numerical representation of the week of the year, starting with the first Monday as the first week]; %b [‘Jan’ — ‘Dec’]; %B [‘January’ — ‘December’]; %h [‘Jan’ — ‘Dec’; alias of %b]; %m [’01’ (January) — ’12’ (December)]; %C [2-digit representation of the century]; %g [2-digit representation of the year, according to ISO-8601:1988]; %G [4-digit representation of %g]; %y [2-digit representation of year]; %Y [4-digit representation of year]; %H [’00’ — ’23’]; %k [‘0′ — ’23’]; %I [’01’ — ’12’]; %l [‘1′ — ’12’]; %M [’00’ — ’59’]; %p [‘AM’ or ‘PM’]; %P [‘am’ or ‘pm’]; %r [same as |
strftime() : returns a string formatted according to format_string, using the given timestamp or the current local time if this parameter is not provided. Supplying unknown conversion specifiers on a Windows system results in 5 E_WARNING messages and a return value of FALSE. Other operating systems might not issue any E_WARNING messages and may output the specifiers unconverted. |
strptime()
[Parse a time/date generated with |
Returns an array with the date parsed. Month names, weekday names, and other language-dependent strings respect the current locale set with setlocale() [LC_TIME]. Internally, this function calls the strptime() function provided by the system’s C library, and does not produce consistent output across different operating systems; it is not even implemented on Windows platforms. The use of date_parse_from_format() is recommended from PHP 5.3.0+. |
strptime(date, format);
[date represents the string to parse (eg. returned from |
strptime() : returns an array on success, or FALSE on failure. The following elements are returned in the array: tm_sec [seconds after the minute — 0-61]; tm_min [minutes after the hour — 0-59]; tm_hour [hours since midnight — 0-23]; tm_mday [day of the month — 1-31]; tm_mon [months since January — 0-11]; tm_year [years since 1900]; tm_wday [days since Sunday — 0-6]; tm_yday [days since January 01 — 0-365]; and unparsed [the date part that was not recognized using the specified format]. |
strtotime()
[Parse about any English textual datetime description into a Unix timestamp] |
This function tries to parse the provided time string into a Unix timestamp, relative to the now timestamp or the current local time if now is not provided. Each parameter uses the default timezone unless a particular timezone is specified in that parameter. | strtotime(time, now [optional parameter, with a default value of time() ]); |
strtotime() : returns a timestamp on success, or FALSE on failure. Prior to PHP 5.1.0 this function would return -1 on failure. |
time()
[Return current Unix timestamp] |
Returns the time in the form of the number of seconds since the Unix Epoch. Since PHP 5.1 the timestamp of the start of the request is available in $_SERVER['REQUEST_TIME'] . |
time(); |
time() : returns the number of seconds since the Unix Epoch. |
DateTimeZone::listAbbreviations() timezone_abbreviations_list() [Returns associative array containing dst, offset and the timezone name] |
This function returns an associative array containing dst, offset, and the timezone name. | Object-oriented:DateTimeZone::listAbbreviations(); Procedural style: timezone_abbreviations_list(); |
DateTimeZone::listAbbreviations() : returns an associative array containing dst, offset, and the timezone name on success; FALSE on failure. |
DateTimeZone::listIdentifiers() timezone_identifiers_list() [Returns a numerically-indexed array containing all defined timezone identifiers] |
This function returns a numerically-indexed array containing all defined timezone identifiers. | Object-oriented:DateTimeZone::listIdentifiers(DateTimeZone_Constant [optional parameter, defaulting to DateTimeZone::ALL ], country [optional parameter, defaulting to NULL ]);
[country is only used when DateTimeZone::PER_COUNTRY is set as the DateTimeZone_Constant parameter. country represents a two-letter ISO 3166-1 compatible country code.] |
DateTimeZone::listIdentifiers() : returns a numerically-indexed array containing all defined timezone identifiers on success; FALSE on failure. |
DateTimeZone::getLocation() timezone_location_get() [Returns location information for a timezone] |
Returns location information for a timezone: country code; latitude; longitude; and comments. | Object-oriented:DateTimeZone::getLocation(); Procedural style: timezone_location_get(dtz_object); |
DateTimeZone::getLocation() : returns an array containing location information about timezone on success; FALSE on failure. |
timezone_name_from_abbr()
[Returns the timezone name from abbreviation] |
This function returns the timezone name from the given abbr. | timezone_name_from_abbr(abbr, gmtOffset [optional parameter], is_dst [optional parameter]);
[gmtOffset represents the offset from GMT in seconds. The default value of -1 means that the first found time zone corresponding to abbr is returned. Otherwise, the exact offset is searched and only if not found then the first timezone with any offset will be returned. |
timezone_name_from_abbr() : returns timezone name on success, or FALSE on failure. |
DateTimeZone::getName() timezone_name_get [Returns the name of the timezone] |
This function returns the name of the timezone. | Object-oriented style:DateTimeZone::getName(); Procedural style: timezone_name_get(dtz_object); |
DateTimeZone::getName() : returns one of the timezone names in the supported list of timezones. |
DateTimeZone::getOffset() timezone_offset_get() [Returns the timezone offset from GMT] |
Returns the offset to GMT for the date/time specified in the datetime parameter. The offset is calculated based on the information contained in the DateTimeZone object. | Object-oriented:DateTimeZone::getOffset(datetime); Procedural style: timezone_offset_get(dtz_object, datetime); |
DateTimeZone::getOffset() : returns the timezone offset from GMT in seconds on success; FALSE on failure. |
DateTimeZone::__construct() timezone_open() [Creates new DateTimeZone object] |
This function creates a new DateTimeZone object. An Exception is thrown if timezone_string is not recognised as a valid timezone. | Object-oriented style:DateTimeZone::__construct(timezone_string); Procedural style: timezone_open(timezone_string);
[timezone_string represents one of the supported timezone names or an offset value (+0200).] |
DateTimeZone::__construct() : returns a DateTimeZone object on success. Procedural style returns FALSE on failure. |
DateTimeZone::getTransitions() timezone_transitions_get() [Returns all transitions for the timezone] |
Returns a numerically-indexed array containing associative array with all transitions. The associative array elements are: ts; time; offset; isdst; and abbr. | Object-oriented:DateTimeZone::getTransitions(timestamp_begin [optional parameter], timestamp_end [optional parameter]); Procedural style: timezone_transitions_get(dtz_object, timestamp_begin [optional parameter], timestamp_end [optional parameter]); |
DateTimeZone::getTransitions() : returns a numerically-indexed array containing associative array with all transitions on success; FALSE on failure. |
timezone_version_get()
[Gets the version of the timezonedb] |
This function returns a string representation of the current version of the timezonedb. | timezone_version_get(); |
timezone_version_get() : returns a string representation of the current version of the timezonedb. |
FILL IN FORM AND CLICK SUBMIT TO ADD YOUR STATISTICS TO THE LEADERBOARD:
Forty-year-old father of three wonderful children [William, Seth, and Alyssa]. Works as an Assistant Technical Officer in the Sterile Services Department of Treliske Hospital, Cornwall. Enjoys jogging, web design, learning programming languages, and supporting Arsenal FC. Obtained a BA degree in English from the University of Bolton in 2008, and has continued to gain qualifications in a diverse range of subjects thereafter.