وظيفة gmstrftime() في PHP
مثال
تنسيق التاريخ والوقت 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 %H:%M:%S representation
- 蒧umeric representation of the day of the week (1 to 7), Monday[星期一] = 1. Warning: In Sun Solaris systems, Sunday[星期日] = 1
- %U - The number of weeks contained in the year, starting from the first Sunday, as the first week, with the first day as the first day of the week
- %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, at least four days, and 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 as the first day of the week
- %w - Decimal number representing the day of the week, Sunday[星期日] = 0
- %x - Preferred date representation without time
- %X - Preferred time representation without date
- %y - Year representation that does not include a number indicating the century (range from 00 to 99)
- %Y - Year representation that includes a number indicating 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: |
return according to format using the given timestamp formatted strings.
Names of months and days of the week and other language-related strings comply with setlocale() current locale settings.
|
PHP Version: |
4+ |