(PHP 5, PHP 7)
idate — ������ʱ�����ڸ�ʽ��Ϊ����
$format
[, int $timestamp
] ) : int
���ݸ����ĸ�ʽ�ַ��� timestamp
��ʽ�����������ֽ����timestamp
Ϊ��ѡ�Ĭ��ֵΪ���ص�ǰʱ�䣬�� time() ��ֵ��
�� date() ��ͬ��idate()
ֻ����һ���ַ���Ϊ format ������
format �ַ� |
˵�� |
|---|---|
| B | Swatch Beat/Internet Time |
| d | �·��еĵڼ��� |
| h | Сʱ��12 Сʱ��ʽ�� |
| H | Сʱ��24 Сʱ��ʽ�� |
| i | ���� |
| I | ���������ʱ���� 1������ 0 |
| L | ����������� 1������ 0 |
| m | �·ݵ����� |
| s | ���� |
| t | ���µ������� |
| U | �� Unix ��Ԫ��January 1 1970 00:00:00 GMT���������——��� time() ������ͬ |
| w | �����еĵڼ��죨�������� 0�� |
| W | ISO-8601 ��ʽ����еĵڼ������ڣ�ÿ���ڴ�����һ��ʼ |
| y | ��ݣ�1 �� 2 λ����——������˵���� |
| Y | ��ݣ�4 λ���֣� |
| z | ����еĵڼ��� |
| Z | ����Ϊ��λ��ʱ��ƫ���� |
Note:
��Ϊ idate() ���Ƿ��� integer��������"0"��ͷ����� idate() ���ܻ᷵�ر��û�������Ҫ�ٵ����֡����������ӣ�
<?php
$timestamp = strtotime('1st January 2004'); //1072915200
// ��������λ���ָ�ʽ��ʾ��ݣ�������Ϊ
// ��"0"��ͷ�����ֻ����ʾ"4"
echo idate('y', $timestamp);
?>