ΗPHP gmstrftime() συνάρτηση

Παράδειγμα

Η格式化 το GMT/UTC χρονικό και ημερομηνία με βάση τη ρύθμιση της περιοχής:

<?php
echo(Ηgmstrftime("%B %d %Y, %X %Z",mktime(20,0,0,12,31,98))."<br>");
setlocale(LC_ALL,"hu_HU.UTF8");
echo(Ηgmstrftime("%Y. %B %d. %A. %X %Z"));
?>

Δημιουργία παράδειγμα

Ορισμός και χρήση

Ηgmstrftime() συνάρτηση格式化 το GMT/UTC χρονικό και ημερομηνία με βάση τη ρύθμιση της περιοχής.

Συμβουλή:Δείτε επίσης strftime() Συνάρτηση, που格式化 το τοπικό χρονικό και ημερομηνία με βάση τη ρύθμιση της περιοχής.

Γλώσσα

Ηgmstrftime(format,timestamp);
Παράμετροι Περιγραφή
format

Απαιτείται. Ορίζει πώς θα επιστρέψει το αποτέλεσμα: Η%a - Η συντομευμένη ονομασία της ημέρας της εβδομάδας

  • Η%A - Η πλήρης ονομασία της ημέρας της εβδομάδας
  • Η%b - Η συντομευμένη ονομασία του μήνα
  • Η%B - Η πλήρης ονομασία του μήνα
  • Η%c - Η προτιμώμενη μορφή ημερομηνίας και χρόνου
  • Η%C - Ο αριθμός του αιώνα (το έτος διαιρείται με 100, το εύρος είναι από 00 έως 99)
  • Η%d - Η μέρα του μήνα (01 έως 31)
  • Η%D - Η μορφή χρόνου, όπως η τελεστική %m/%d/%y
  • Η%e - Η μέρα του μήνα (1 έως 31)
  • Η%g - Η ίδια με την τελεστική %G, αλλά χωρίς αιώνα
  • Η%G - Το τετραψήφιο έτος που αντιστοιχεί στο ISO εβδομαδιαίο αριθμό (βλέπε %V)
  • Η%h - Η ίδια με την τελεστική %b
  • Η%H - Η ώρα, με σύστημα 24ωρών (00 έως 23)
  • Η%I - Η ώρα, με σύστημα 12ωρών (01 έως 12)
  • Η%j - Η μέρα του έτους (001 έως 366)
  • Η%m - Ο μήνας (01 έως 12)
  • Η%M - Η λεπτά
  • Η%n - Η χαρακτήρας νέας γραμμής
  • Η%p - Η αντιστοιχία του χρόνου με am ή pm
  • Η%r - Η μέθοδος σημείωσης χρόνου π.μ. και μ.μ.
  • Η%R - Η μέθοδος σημείωσης χρόνου 24ωρης
  • %S - Seconds
  • %t - Tab
  • %T - Current time, the same as the %H:%M:%S representation
  • 蒧umeric representation of the day of the week (1 to 7), Monday[Monday] = 1. Warning: In Sun Solaris systems, Sunday[Sunday] = 1
  • %U - The number of weeks contained in the year, starting from the first Sunday, as the first week, with the first day of the week being Sunday
  • %V - The number of weeks contained in the year according to the ISO 8601 format (01 to 53), week 1 represents the first week of the year, which must have at least four days and start with Monday as the first day of the week
  • %W - The number of weeks contained in the year, starting from the first Monday, as the first week, with the first day of the week being Monday
  • %w - Decimal number representing the day of the week, Sunday[Sunday] = 0
  • %x - Preferred date representation without time
  • %X - Preferred time representation without date
  • %y - Year representation that does not include a number representing the century (range from 00 to 99)
  • %Y - Year representation that includes a number representing the century
  • %Z or %z - Time zone name or abbreviation
  • %% - Output a % character
timestamp Optional. Specifies the Unix timestamp representing the date/time to be formatted. The default is the current local time (time()).

Technical Details

Return Value:

returns according to format using the given timestamp formatted strings.

The names of the months and days of the week, and other language-related strings comply with setlocale() current locale settings.

PHP Version: 4+