gmstrftime
(PHP 4, PHP 5, PHP 7)
gmstrftime � ����������� ����/����� �� �������� � ������ ������� ������
��������
��� ������� ��������� ������� strftime() �� ����������� ����, ��� ���������� ����� �� �������� (GMT). ��������, ��� ������� �� �������, ��� ����������� Eastern Standard Time (GMT-0500), ������ ������ �� ������� ���� ������� «Dec 31 1998 20:00:00», ����� ��� ������ — «Jan 01 1999 01:00:00».
������ ����������
�������� �������� ������� strftime() .
�������������� �������� timestamp ������������ ����� ����� ������� ���� integer , �� ��������� ������ �������� ���������� �������, ���� timestamp �� ������. ������� �������, �������� �� ��������� ����� ���������� ������� time() .
������������ ��������
���������� ������, ����������������� �������� ���������� ������� � � �������������� ��������� ����� �� ��������� timestamp ��� �������� ���������� �������, ���� ��������� ����� �� ���� �������. �������� �������, ���� ������ � ������ �������������� ����� ����� �������� � ������ �������� ������� ������, ������������� � ������� ������� setlocale() .
�������
������ #1 ������ ������������� ������� gmstrftime()
�������� �����
- strftime() — ����������� ������� ����/����� � ������ ������� �������� ������
��� ����� ��� gmstrftime
(PHP 3>= 3.0.12, PHP 4 , PHP 5)
gmstrftime — Форматирует дату/время по Гринвичу с учетом текущей локали
Описание string gmstrftime ( string format [, int timestamp] )
Пример 1. Пример использования функции gmstrftime()
См. также описание функции strftime() .
If you want the dutch time on your pages and you are hosted on a server in the USA you can easily change it this way:
setlocale(LC_TIME, ‘nl_NL’);
$tgl= gmstrftime(«%d %B %Y — %H:%M uur»,time()+3600);
Then use $tgl to display the right time.
Note the +3600 is a day light savings time correction.
The result: 22 maart 2005 — 16:39 uur
First I used the normal date function and this was the previous result: March 22, 2005 — 04:28 AM
I needed it for a dutch guestbook.
I’m new to PHP and it took me a while to find it out and maybe it’s of no use for experienced PHP programmers but I thought people can always ignore my post
gmstrftime() should not be used to generate a RFC 850 date for use in HTTP headers, since its output is affected by setlocale().
Use gmdate instead:
gmdate(‘D, d M Y H:i:s’) . ‘ GMT’;
HTTP 1.1 (RFC 2068) requires an RFC 1123 date with a four digit year, so the correct format to use for a Last-modified header would look something like this:
( «Last-modified: » .
gmstrftime ( «%a, %d %b %Y %T %Z» , getlastmod ()));
?>
To get a RFC 850 date (used in HTTP) of the current time:
gmstrftime («%A %d-%b-%y %T %Z», time ());
This will get for example:
Friday 25-Jun-04 03:30:23 GMT
Please note that times in HTTP-headers _must_ be GMT, so use gmstrftime() instead of strftime().
Gmstrftime
Php �������
Php �������
gmstrftime
(PHP 3 >= 3.0.12, PHP 4, PHP 5)
gmstrftime — ����������� ����/����� �� �������� � ������ ������� ������
��������
string gmstrftime ( string format [ , int timestamp ] )
��� ������� ��������� ������� strftime() �� ����������� ����, ��� ���������� ����� �� �������� (GMT). ��������, ��� ������� �� �������, ��� ����������� Eastern Standard Time (GMT -0500), ������ ������ �� ���������� ������� ������� «Dec 31 1998 20:00:00», � ������ — «Jan 01 1999 01:00:00».
|
��. ����� �������� ������� strftime().
User Contributed Notes
pvdster at hotmail dot com
22-Mar-2005 06:50
If you want the dutch time on your pages and you are hosted on a server in the USA you can easily change it this way:
setlocale (LC_TIME, ‘nl_NL’);
$tgl = gmstrftime(«%d %B %Y — %H:%M uur», time ()+3600);
Then use $tgl to display the right time.
Note the +3600 is a day light savings time correction.
The result: 22 maart 2005 — 16:39 uur
First I used the normal date function and this was the previous result: March 22, 2005 — 04:28 AM
I needed it for a dutch guestbook.
I’m new to PHP and it took me a while to find it out and maybe it’s of no use for experienced PHP programmers but I thought people can always ignore my post
peter dot albertsson at spray dot se
05-Feb-2005 06:27
gmstrftime() should not be used to generate a RFC 850 date for use in HTTP headers, since its output is affected by setlocale ().
Use gmdate instead:
gmdate (‘D, d M Y H:i:s’) . ‘ GMT’;
yellow dot snow at huskies dot com
10-Oct-2004 08:15
HTTP 1.1 (RFC 2068) requires an RFC 1123 date with a four digit year, so the correct format to use for a Last-modified header would look something like this:
header ( «Last-modified: » . gmstrftime ( «%a, %d %b %Y %T %Z» , getlastmod ())); ?> |
neo at gothic-chat d0t de
25-Jun-2004 10:27
To get a RFC 850 date (used in HTTP) of the current time:
gmstrftime («%A %d-%b-%y %T %Z», time ());
This will get for example:
Friday 25-Jun-04 03:30:23 GMT
Please note that times in HTTP-headers _must_ be GMT, so use gmstrftime() instead of strftime().
gmstrftime
gmstrftime � ����������� ����/����� �� �������� � ������ ������� ������
��������
��� ������� ��������� ������� strftime() �� ����������� ����, ��� ���������� ����� �� �������� (GMT). ��������, ��� ������� �� �������, ��� ����������� Eastern Standard Time (GMT-0500), ������ ������ �� ������� ���� ������� «Dec 31 1998 20:00:00», ����� ��� ������ — «Jan 01 1999 01:00:00».
������ ����������
�������� �������� ������� strftime() .
�������������� �������� timestamp ������������ ����� integer ����� �������, �� ��������� ������ �������� ���������� �������, ���� timestamp �� ������. ������� �������, �������� �� ��������� ����� ���������� ������� time() .
������������ ��������
���������� ������, ����������������� �������� ���������� ������� � � �������������� ��������� ����� �� ��������� timestamp ��� �������� ���������� �������, ���� ��������� ����� �� ���� �������. �������� �������, ���� ������ � ������ �������������� �����, ����� �������� � ������ �������� ������� ������, ������������� � ������� ������� setlocale() .
�������
������ #1 ������ ������������� ������� gmstrftime()
�������� �����
- strftime() — ����������� ������� ����/����� � ������ ������� �������� ������
����������
To get a RFC 850 date (used in HTTP) of the current time:
gmstrftime («%A %d-%b-%y %T %Z», time ());
This will get for example:
Friday 25-Jun-04 03:30:23 GMT
Please note that times in HTTP-headers _must_ be GMT, so use gmstrftime() instead of strftime().
HTTP 1.1 (RFC 2068) requires an RFC 1123 date with a four digit year, so the correct format to use for a Last-modified header would look something like this:
( «Last-modified: » .
gmstrftime ( «%a, %d %b %Y %T %Z» , getlastmod ()));
?>
gmstrftime() should not be used to generate a RFC 850 date for use in HTTP headers, since its output is affected by setlocale().
Use gmdate instead:
gmdate(‘D, d M Y H:i:s’) . ‘ GMT’;
If you want the dutch time on your pages and you are hosted on a server in the USA you can easily change it this way:
( LC_TIME , ‘nl_NL’ );
$tgl = gmstrftime ( «%d %B %Y — %H:%M uur» , time ()+ 3600 );
?>
Then use $tgl to display the right time.
Note the +3600 is a day light savings time correction.
The result: 22 maart 2005 — 16:39 uur
First I used the normal date function and this was the previous result: March 22, 2005 — 04:28 AM
I needed it for a dutch guestbook.
I’m new to PHP and it took me a while to find it out and maybe it’s of no use for experienced PHP programmers but I thought people can always ignore my post
������ � ���������� ������ � PHP
��� ������ ������ ��������� ���� ������� �� ������������ ���������� ������������ � ������ ��������� ��� ����������, ������ ������ � ���������� ��������� ���. ����� � ������� � ����� ��������� �������� �������� ��������� � ������ ��������� ��� (��� � ��������� ����������� ����������, ��� � � ��������� �������) ���� ���������� ��������� �����.
�������� ��������� ���
- ����������� ���� �� ����� ����� ������� ��������
- ��������� ����� ����� ����������� ��� ����������-�������� ��������� ��������
- � ��������� ������ ��������� ���� �������� � ������� ����
�������� �������� �������
- ��������� ����� ��������� ����� ���� ��������� ����������������� ������� ����� �����
- ��� ������ �� �� ���� �������
- ������� ����� ���������� � ������ �����
- ���������� ������� ���������� ����������
������ �������� ��������� ��� � ��������� �������
- � ��������� ���� ������ ������������
- � �������� ����, ����� ��������� ������, �������� ������ ���
- �� ������ Lord Howe (���������) ��������� ������� ������ �� ������
- ����� ��������� ������� �� 15 �����
�������� � ������������ ��������� ���
- ���� ���������� ����� �������� ������ ��������� ����:
��������:PST � Pacific Standart Time � Pakistan Standart Time
EST � Easten Standart Time (���), Easten Standart Time (���������) � Easten Brazil Standart Time - ���� ���� ����� ����� ��������� ������������
����� ����, � ������ ������������ �������� ����� ��� ����� �����������.
�������� � ������������� ���� � �������
- ���������������
06/08/04
6 ������� 2004 ����
8 ���� 2004 ����
4 ������� 2006 - ������������
20040425010541
25 ������ 2004 ���� 01:05:41 - ������ ����������� �������
third saturday
2004-03-10 16:33:17.11403+1
2001-11-29T13:20:01.123-05:00
23:41:00.0Z
04:05:07.789 +0930
1999.238
������� � php 4 � php 5 ��� ������ � �������� � ������
- checkdate � ��������� ������������ ���� �� �������������� ���������
- date(gmdate) � ����������� ��������� ����/����� (�� ��������)
- getdate � ���������� ���������� � ����/�������
- gettimeofday � ���������� ������� �����
- localtime � ���������� ��������� �����
- mktime(gmmktime) � ���������� ����� ������� ��� �������� ���� (�� ��������)
- strftime(gmstrftime) � ����������� ����/����� � ������ ������� ������ (�� ��������)
- strtotime � ����������� ��������� ������������� ���� �� ���������� ����� � ����� ������� Unix
����������� ������ � ������
- ������������� Unix-���������� � �������� ���� (���������� ������, ��������� � 1 ������ 1970 ���� �� ��������)
- ��������� �������������� ����� 32-������� ������, ��� ������������ ������������� ������� ������������� ���������� 1902-2038 ������
- �� ������ ������������ �������� ������ ��� ����� ���� ������ �������������, ����������� ��������� 1970-2038
- strtotime � �������� ������� �������, ���������� ������� ���������� ������� ����������� ������
- ��� ��������� ���������� ������ � ���������� ������
- ��������� ������� �������� ���������� �� ������������ �������
��������� ������ � ������ � php 5.1 � ����
- ������������� 64-������� ���� ��� �������� ����. ������ ������� ��������� ������������� ������� ���� 4 ������� 292277026596 ���
- ������� strtorime ���� ����������
- ������ ��� ����������� � ���������� �� ������������ �������
- ������ ��������� ��������� ���, �������� ����� � ������������� ���
- ����� ������ ������������� ��������� ���
- ����� ����������� ������� ��� ������ � ������
������� ������ � php 5.1 � ����
������������ ������: 9/11;4:08 pm;12/22/78; 8:51:00 am
��������������� ������: Sat, 24 Apr 2004 21:48:40 +0200; 2001-11-29T13:20:01.123-05:00
������������ ������: tomorrow; four months ago; last saturday; +20 days 2 hours
��������� ������: December 22. 1978; 22-december-1978
��� ISO 8601 �������: 1978/12/22; 13:03:12.45678; 13:03:12.45678 +0100; 15:57-8; 1978-12-22; 15:57:41 pdt; 13:03:12.45678 CEST; 231431 CEST; 70-4-25; 13:03 CEST; 04:05 -0930; 23:41F
������� ��� ������: 1999-Jan-08; 1999.238
��������� ��������� ��� � php 5.1 � ����
- ���������� ���� �� 551 ��������� ����
- ��� ����������� �� ������������ ��������� ����
- �������� ��������� ��� ����� ������ � Continent/Location ��� Continent/Location/Sublocation
��������� ��������� ���. ��� ������������?
- ������ ��������� ���� ���������������� ������� � ���������� ���������� �� ������ ����������
- ���� ��������� �� 10 ������� �����: ������, �������, ����������, �������, ����, ������, �����, ����� �����
- ���������� ����� ������ ������, ��������� �� �������� �� ������������ �������� � �������� ��� ����������� �������� �������������
- ������ ���������� �� ������������� ��������� ��� �� ���������� ������
��������� ���������� �� ��������� �����
- ���������� ���������� �� ��������� ����� ���������� ����� 20 ��� � ���
- ����������� ���������� ���������� ����������
- ����� �� �������� ������������, ������ php ������ ���� ���������� �����
- ���������� pecl, ������� ���������� ������ ����������, ���������� timezonedb (pecl install timezonedb)
������ ��� (�������)
������ ������ � ���������� � ���� � ������� ��������� ������� strtotime
$date=strtotime(�2005-07-11 22:16:50 CEST�);
$ts=strtotime(�next week�,$date);
date_default_timezone_set(�Europe/Oslo�);
$ts=date_create(�1979-12-31 09:15�);
echo date_format($ts,�D Y-m-d H:i:s -\I\S\O \W/\Y: W/o�);
date_default_timezone_set(�Europe/Oslo�);
$ts=date_create(�December 22nd, 2005 15:41�);
echo date_format($ts, DATE_ISO8601);
echo date_format($ts, DateTime::RFC1036);
echo date_format($ts, DATE_RSS);
date_default_timezone_set(�Europe/Oslo�);
$ts=date_create(�December 22nd, 2005 15:41�);
$locales=array(‘en_US’,’fr_CA’,’nb_NO’,’ru_RU’,’ar_SA’,’ja_JP’);
foreach($locales as $locale)
<
locale_set_default($locale);
echo date_format_locale($ts,DATE_RFC2822).»\n»;
>
$date=new DateTime(‘now’);
echo $date->format(DateTime::ISO8601).»\n»;
$date->setTime(15,0,7);
echo $date->format(DateTime::ISO8601).»\n»;
$date->setDate(2006,12,22);
echo $date->format(DateTime::ISO8601).»\n»;
$date->setIsoDate(2006,45,2);
echo $date->format(DateTime::ISO8601).»\n»;
date_default_timezone_set(�Europe/Oslo�);
$date=new DateTime(‘now’);
echo $ts->format(DATE_RFC2822).»\n»;
$ts->modify(«+2 days»);
echo $ts->format(DATE_RFC2822).»\n»;
$ts->modify(�fifth month�);
echo $ts->format(DATE_RFC2822).»\n»;
$ts->modify(�Friday +3 weeks�);
echo $ts->format(DATE_RFC2822).»\n»;
$ts->modify(�next friday�);
echo $ts->format(DATE_RFC2822).»\n»;
date_default_timezone_set(�Europe/Oslo�);
$ts=date_create(�1978-12-22 09:15�);
echo $ts->format(‘e’);
$tz=new DateTimeZone(‘Pacific/Honolulu’);
$ts1=new DateTime(‘1978-12-22 09:15 CEST’,$tz);
$ts2=new DateTime(‘1978-12-22 09:15 Europe/Amsterdam’,$tz);
echo $ts2->format(DateTime::RFC2822);
$tz=timezone_open(‘Asia/Singapore’);
echo timezone_name_get($tz);
$tz=timezone_open(‘CEST’);
echo timezone_name_get($tz);
$tz=new DateTimeZone(�Europe/Amsterdam»);
$d=new DateTime(�2005-01-22 09:15�);
echo $tz->getOffset($d);
$d->modify(«+6 months»);
echo $tz->getOffset($d);
$tz1=timezone_open(‘Pacisic/Honolulu’);
$tz2=timezone_open(‘Europe/Amsterdam’);
$tz3=timezone_open(‘Australia/Melbourne’);
$ts=date_create(�1978-12-22 09:15�,$tz1);
echo $ts->getTimezone()->getName().’:’.$ts->format(DATE_RFC822).»\n»;
$ts->setTimezone($tz2);
echo $ts->getTimezone()->getName().’:’.$ts->format(DATE_RFC822).»\n»;
$ts->setTimezone($tz3);
echo $ts->getTimezone()->getName().’:’.$ts->format(DATE_RFC822).»\n»;
$tz=timezone_open(‘Europe/Amsterdam’);
$trs=timezone_transitions_get($tz); // ��� $trs=$tz->getTransitions();
foreach($trs as $ts)
printf(«%20s %7d %d %s\n»,$tr[‘time’],$tr[‘offset’],$tr[‘isdst’],$tr[‘abbr’]);
$ > echo �Number of identifiers: �.count($ids).»\n»;
echo implode(«, «, array_slice($ids, 0, 5)).’. ‘.implode(«, «, array_slice($ids, -5));
$abbrs = timezone_abbreviations_list();
foreach ($abbrs as $abbr => $ids)
foreach ($ids as $id)
printf(«%-6s %6d %d %s\n», strtoupper($abbr),$id[‘offset’],$id[‘dst’], $id[‘timezone_id’]);
date_default_timezone_set(�America/New_york�);
$tz = new DateTimeZone(�America/New_york�);
foreach (timezone_transitions_get($tz) as $tr)
if ($tr[‘ts’] > time()) break;
$d = new DateTime( «@<$tr['ts']>» );
printf(�The timezone %s switches to %s on %s.\nThe new GMT offset will be: %d (%s)\n�, $tz->getName(), $tr[‘isdst’]? �DST�: �standard time�, $d->format(‘d M Y @ H:i T’), $tr[‘offset’], $tr[‘abbr’]);
����� �������� ������ ����������������
� php 5.1 ���������� ��������������, ��������� ���� CFLAGS=-DEXPERIMENTAL_DATE_SUPPORT=1
� php 5.2 � ���� �� ���������
�������� �� ��� ������� � ??������� gmstrftime() PHP?
� ���� �������� � �������� gmstrftime() PHP. ����������, ��������:
��� �� ������ ������, ������ ����� ������� 2 ���� ���������� (�� ������ � MySQL), ������� �������� ���������� ��-�� ��������� ������� ������. �� ������ — ����� 1 ���, �� � �� ������� ������� ���� ����� ����� �������� gmstrftime()?
�������� �� ��� ������� � ??������� gmstrftime() PHP ��� ���-�� ���?
������ 25 ���. 12 2012-09-25 12:06:02 Erik
1 �����
����� ��, ��� STRFTIME() �� ����������� ����, ��� ����� ������������ � ������� ����� �� �������� (GMT).
������� ����� �� �������� ������� ���. ��� ���������� �� �������� ������� � ��������������, ������� ����� ��������������� ��� GMT, �� ����� — ����������� ������ ������ (GMT + 1, �. �. �� ��� ������ GMT). �� �� ����� ���������� � �������� ������, ������� ���������� + 1 �����, � ����� + 2 �����.
���� ���� ������ MySQL, ��-��������, ��������� ��� �������� ������������ �������, ������� ��� �������������� ��������� ������� Unix, ������� ��������� � ������� ����, ��� ��������� �������������� ���, ����� ����������� ��������� Summer Time.
�� ��� ������, ������ �������� — ���������� ��� ���� ������� �� ������������� �UTC� (� �������� �� �� �����, ��� � GMT), � ����� ������������� � ��������� ������� ���� �� ��������� ������. �� ������ ����������������� �����-�� ������ ������� ����, �� UTC ��������� ��� ������� ������� ����� ��� �������.
������ 25 ���. 12 2012-09-25 12:16:09 IMSoP
������� �������� ����������� � ���, ����� ���������� ��� ���� ������� �� ������������� UTC �. — � ������ �������� ��� ���� ������� � ������� �����, ������� ��� ������ �������� (TZ, � ������� � ����), � �� �������� ��� �������. � zerkms 25 ���. 12 2012-09-25 12:17:31
@zerkms ���� �� ���������� ��� ��� �������� UTC, ����� ��, ��� ����� ������. �� ���� �� ���������� ��� � ������ ����� � ����� ��� ����������� �������������� ������ �����/DST, ��� ����� ���������� *, �� ����� ����� *. � IMSoP 25 ���. 12 2012-09-25 12:20:40
��� ������ �������: 1) ������������ ����� ������� ���� �������. 2) ������ ����������� ���������� ���� ��� ��� � ������ ��������� � ������, ��������� ���������� �����������. � ��� ������ �������� ��� ���� PS: http://rwec.co.uk/ — uh-oh
� zerkms 25 ���. 12 2012-09-25 12:22:30
@zerkms ���������� ����������� ������������� UTC ��� ����� — ������ ������ ������ ����� ������������ — ������ ����, ����� �������������, ��� ��� ����������� �������������� �� ��������� ������� ������, �������������, ��� ��� ����� ���� ������� ����. � IMSoP 25 ���. 12 2012-09-25 12:25:12
������� � ������� � ��������, ������� ��������� �� ����� �������� ��������, ��� ���� ���� ������� ���� — ��� (� �� ���� ������ ��������, ��� ���������� ���) ��� ����� ��������� ����� � ������ ��������� ����� �������. ��� ���� ������� ������ ������� ������� � ���, ��� ��������� ������������ ���� � oracle � zerkms 25 ���. 12 2012-09-25 12:27:46
�������� � ���, ��� �� ����� ��� �������� �� ������ IP.Board ����� ������� ������ �� VBulletin. � Erik 25 ���. 12 2012-09-25 12:39:01
���-������ �����, ��� �� ����� ��� ���������? � Erik 25 ���. 12 2012-09-25 12:39:30
@Erik ������� ������ �� ����, ��� �� ������. ���� ������ MySQL ����� ������� ���� � �����, �� ������ �������� ��� �� �������� �����, ������� ������� IP.Board. ������, ���� ���������� � ������� ����� �� ���� ����������� ��� �������� � �������, ����� ��������� ������� ���������� ����������� �������� ��� ������ ����. � ����� ������ �������� ���� ������ ������ �������� — PHP ����� ���� ���������. � IMSoP 26 ���. 12 2012-09-26 07:05:37
@zerkms ������� ������� �� ����, ����� ��������� ����� �������� � ���� — ��� ���������������� ������������� �� ������, �������� ��������� �������� ����� �������, �������� ���������.� � ��������� �����������, ��� � �������, ����� ������ ������������ ��� �������� ������, �� � ��� �� ����� API, ������� ���������, ����� ������� ���� �� ����� ���� ����, ������� ������� ��� ��� ������� ������������� � ������� ����� ����������. : | PS: ������� �� ����-�� re rwec.co.uk — �����-�� �������� WordPress, ������� � ���������� � IMSoP 26 ���. 12 2012-09-26 07:16:27
@IMSoP: �������� ������� �� ����, ����� ��������� ����� �� ��������� � — � ����������� �����������, ������� � ������ ������������ (postgresql ���������� �� ������), ���������� ����� ������ � ������ � ���� �� ���� �������� � php ‘time()’ � unix timestamps ������. �� ������������� — ��������, � ��� �� �������� ������, ����� ��� ������� �� �������� � zerkms 26 ���. 12 2012-09-26 09:41:51
����� �����
����� ������-������������ ������� ���������� � ��� ������ ��������� ������� ��������� ��� �� ��������, ������� ���������� ������� � ������ � ������� ����������� ���������� ������� � �������� �� ������������� �����. �������� �� �������� ������ � ���������� �������, ����� ����������� ����� � ������ ��� ��� ���� ������������� ���������, �������� � ����, �������� �� ������� ������ � ������� ����� ����������� �������. �� �������� � ������� � ������� �������������� ����������, ������� ������ � ������� �������.
����� ������������� �� ��������� � ����� ������� ������������ ������� �������, ������������ � ����������� ������, �������������� ����������, ��������� �����������, ���������� � ����� ��������, ��������� � ������, � ����� ������� � �������� �������� � ���� ���, ��� ������������� � �������� ���������� ������� � �������� � �� ����������� �� ������������� �����.
gmstrftime
gmstrftime � ����������� ����/����� �� �������� � ������ ������� ������
��������
��� ������� ��������� ������� strftime() �� ����������� ����, ��� ���������� ����� �� �������� (GMT). ��������, ��� ������� �� �������, ��� ����������� Eastern Standard Time (GMT-0500), ������ ������ �� ������� ���� ������� «Dec 31 1998 20:00:00», ����� ��� ������ — «Jan 01 1999 01:00:00».
������ ����������
�������� �������� ������� strftime() .
�������������� �������� timestamp ������������ ����� integer ����� �������, �� ��������� ������ �������� ���������� �������, ���� timestamp �� ������. ������� �������, �������� �� ��������� ����� ���������� ������� time() .
������������ ��������
���������� ������, ����������������� �������� ���������� ������� � � �������������� ��������� ����� �� ��������� timestamp ��� �������� ���������� �������, ���� ��������� ����� �� ���� �������. �������� �������, ���� ������ � ������ �������������� �����, ����� �������� � ������ �������� ������� ������, ������������� � ������� ������� setlocale() .
�������
������ #1 ������ ������������� ������� gmstrftime()
�������� �����
- strftime() — ����������� ������� ����/����� � ������ ������� �������� ������
����������
To get a RFC 850 date (used in HTTP) of the current time:
gmstrftime («%A %d-%b-%y %T %Z», time ());
This will get for example:
Friday 25-Jun-04 03:30:23 GMT
Please note that times in HTTP-headers _must_ be GMT, so use gmstrftime() instead of strftime().
HTTP 1.1 (RFC 2068) requires an RFC 1123 date with a four digit year, so the correct format to use for a Last-modified header would look something like this:
( «Last-modified: » .
gmstrftime ( «%a, %d %b %Y %T %Z» , getlastmod ()));
?>
gmstrftime() should not be used to generate a RFC 850 date for use in HTTP headers, since its output is affected by setlocale().
Use gmdate instead:
gmdate(‘D, d M Y H:i:s’) . ‘ GMT’;
If you want the dutch time on your pages and you are hosted on a server in the USA you can easily change it this way:
( LC_TIME , ‘nl_NL’ );
$tgl = gmstrftime ( «%d %B %Y — %H:%M uur» , time ()+ 3600 );
?>
Then use $tgl to display the right time.
Note the +3600 is a day light savings time correction.
The result: 22 maart 2005 — 16:39 uur
First I used the normal date function and this was the previous result: March 22, 2005 — 04:28 AM
I needed it for a dutch guestbook.
I’m new to PHP and it took me a while to find it out and maybe it’s of no use for experienced PHP programmers but I thought people can always ignore my post
�������� � ������������ �������, ��������� gmstrftime
����� � ������� ���������� 160000 � gmstrftime.it ���������� 20:26, �� ��� 80000 ��� ���� 22:13. � �� ������, ������ ��� happening.Is �� �����-���� ������� ��� gmstrftime?
160000 �� ������� ������� ����� — ���� ������� , ��� PHP (��� ������ ����� �������) ���������� ��������� �����. ��� � ��� ���� ����� ���� ����� ����� , ���������� � �������� ������ �������� � ���� ������ �����. ���� , ������ �����, ����� gm �������, �������� , �� �� , ��� �� ������ ������������, ��� ��� ��� �� ������� ���������� �������� ����� �� ����� ������ ������� , ����� ������ �, ������������� , �������������� � GM ����� ������������ , ���� �� ����������.
������, ��� �� ������ ���� � ��������� ������� ���:
������� ����, ��� deceze ������ �� ������ �������� �������� ����� ��� Unix �������. ���������� ������, ��������� � 1 ������ 1970 00:00. ���� �������� ������ ARG, ��� �� �������� ������� �����.
�������� ��������� ���� ��� $ time1 � $ time2 ������� ����� �����.
Volkswagen Jetta Frost � ���������� � ��� ����������?
������ ���������� ���-��� ����� ��� ��� �����.
�������� �� �����, ��� ���� ����� ����� ��� ��� ����������.
�� � ���� 2 �������� �������:
1. ������ �� �����? ��� ����?
2. ������ ���� ����� ��� ��������� ������ �������� ��������� �����? ������ ��������� �����, � �� �������������
���������� ��� ����. ����� �����, ��� � �������� �� ���� ������, ������ ������� � ����������.
� ���, �������� � ��� ��� ���������� �� ����� � ���-�� �� ������� ��������.
�� ���������� 2 �����: 1. �� �� ������ �������� ������� ������ ��� ���� ����������, 2. ���-�� ����� �� �������, ��� ����� ��� ��������� ������� ������ �������.
��� ��������� � ���� ������ ��������� �� ������� ��������, ����� ������� � ������ ������ ���� � VCDS.
����� ��������� ������ � ����� ������.
� ������, ��� ������ � ���� ��� ���������� ������ ��� �� 0 � �.�. ��� ��, � ��� �������� � 2-� ������.
����� ��� ��� �������� ��� ���� ��� ����������.
�� ����� �������, �� �������. � ����� ������ �� ����� � ����� ���������� VCDS. ��� ���� ���� ��� ���������� � ��� ���������.
�� ��� CAXA � ��� ������� ��������� ���� ����������. ��� � ��������.
��, �����, ����� ������ ��� ��� �������� � VAS.
���� �� ������ ����� ����� �������� ���, �� ����� ������ �������
���������� � ��������� ������.
�������� VAS PC � �������� ��������� ��������� ����� ����, ������� �� ������-�� ����� � ����� ������� �� ������� ��� ���� �������
������ �� ���, �������� ���� ������ (����� �� ���-�� �� ������ ��� ����� �� ������!), ���10 ����� ���� �����������
���������� (� ��� ������ ��� � ����� ����), ���������� ����� �� 10 ��� ���� ����� ��������� (�� ����� �������� ���).
�������� ������� �� ���� �� ����� � ��������!
�� ���� ������������? ��� �� �������, � ����� ������, ��� ����� ������ �� ��������. ��� ��� ���� ����������?
�����, � ����� ������� ������� ��� ��� ���� � ������ (����� ���� ���� �� ��� ������)
����������� �������� �� �������, �� � ��� ����� 15�� � ��������� ������.
����� �������, �� �����. �������, ����� � ������ ����� � ������� ����������.
!��������: �������, �� ���������� ��������� ���� ���������� � ������! ))))
� ������� ����� ����������� ���������, � ����� �� ��������� )))
���� ��� �����, � ��� ����������� ����� ���������� � ������ ������� 5��/������������� �������� ���� ))))
������ �� �������� �������� � �����������, �� ���������� ��������� �����, ����� ���� ������ ������.
������ � ���� ������� ���� � ���������� ��� ���� �����, ��� ������ ������ (� ����������� �� ��������)
� �������, �� ������, � ��� ����� � ����.
�����������, ����� ���������� �����, ��� ������ �� ���� �� ������ ������ � ���������� ���� ��� �����.
�������� ���� � �� ��� ��� ����� ������-������ ��������.
��������������� �� ��������� � ����� �� ������� ������.
������� � ������ ����� � ������� ������ � ��� � � ����� ��.
� ����� ��� �������� �������� �� ����� ����� ��, �� ��� ����� halten� � �����, ������ �� ���������� halt, �� ������� ���������� ������ ����� � �������� � ����� 10 ))))
���� ��� ��������, ������� � ����� ������� � ��������� ��� �����
���� ������� � ������� «�������»! )))
�����, �������� ���� ����, ����� �������� ���.
����� ����� ������� � �������
����� 6-7 ��� ��������� �����-�� �����.
� ����� ������� ��������, ��� ��� ������������ � ������ ������� ������. ������ ���� � �� ������.
��� ��� ������� �����. � � ������ ��� ������� ���-����� � ������.
�����, ������ ���. ��������.
������ � ���, ��� ������� ���� ���������� � ���� ��� ���� � ����� ������.
���������� ������ � ��� ������ ���������, ������ ��� �������� �������������.
�� �������.�. ��� �� ����� � ���� ���� �� �� �������, � ��� ���������� ������ �� �������������.
��� ��� ����. ���� ����� �� ���-������ ��� �� ������ � ��������� ���������� ��� �����.
�� � ������ ��� ���������, ��� ��� �� ����� � ������ ��� ���� ����� ���� �����? ))))