Forum und email
Funkce pro datum a čas

XXII. Funkce pro datum a čas

Úvod

Tyto funkce vám umožňují získat datum a čas ze serveru, na kterém běží PHP skripty. Lze je použít k formátování zápisu času a data mnoha různými způsoby.

Poznámka: Uvědomte si prosím, že tyto funkce závisí na národním nastavení vašeho serveru. Zvláštní pozornost věnujte letnímu času a přestupným rokům!

Požadavky

Tyto funkce jsou k dispozici jako součást standardního modulu, který je vždy dostupný.

Instalace

K používání těchto funkcí není třeba žádná instalace, jsou součástí jádra PHP.

Konfigurace běhu

Toto rozšíření nemá definováno žádné konfigurační direktivy.

Typy prostředků

Toto rozšíření nemá definován žádný typ prostředku (resource).

Předdefinované konstanty

Toto rozšíření nemá definovány žádné konstanty.

Obsah
checkdate -- Zkontroluje gregoriánské datum
date_create -- Returns new DateTime object
date_date_set -- Sets the date
date_default_timezone_get --  Gets the default timezone used by all date/time functions in a script
date_default_timezone_set --  Sets the default timezone used by all date/time functions in a script
date_format -- Returns date formatted according to given format
date_isodate_set -- Sets the ISO date
date_modify -- Alters the timestamp
date_offset_get -- Returns the daylight saving time offset
date_parse -- Returns associative array with detailed info about given date
date_sun_info -- Returns an array with information about sunset/sunrise and twilight begin/end
date_sunrise -- Returns time of sunrise for a given day and location
date_sunset --  Returns time of sunset for a given day and location
date_time_set -- Sets the time
date_timezone_get -- Return time zone relative to given DateTime
date_timezone_set -- Sets the time zone for the DateTime object
date -- Formátuje místní datum/čas
getdate -- Vrací informaci o datu/čase
gettimeofday -- Vrací aktuální čas
gmdate -- Formátuje datum/čas GMT/UTC
gmmktime -- Vrací UNIXové časové razítko pro datum/čas v GMT
gmstrftime --  Formátuje datum/čas v GMT/UTC vzhledem k národnímu nastavení
idate -- Format a local time/date as integer
localtime -- Vrací místní čas
microtime --  Vrací aktuální UNIXové časové razítko s mikrosekundami
mktime -- Vrací UNIXové časové razítko pro datum/čas
strftime --  Formátuje místní čas/datum s ohledem na nastavení národních specifik
strptime --  Parse a time/date generated with strftime()
strtotime -- Parse about any English textual datetime description into a Unix timestamp
time -- Return current Unix timestamp
timezone_abbreviations_list -- Returns associative array containing dst, offset and the timezone name
timezone_identifiers_list -- Returns numerically index array with all timezone identifiers
timezone_name_from_abbr -- Returns the timezone name from abbrevation
timezone_name_get -- Returns the name of the timezone
timezone_offset_get -- Returns the timezone offset from GMT
timezone_open -- Returns new DateTimeZone object
timezone_transitions_get -- Returns all transitions for the timezone