亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Home php教程 php手冊 Commonly used time functions in php

Commonly used time functions in php

Oct 22, 2016 am 11:56 AM

Test environment: php5.3.29

unix timestamp (number of seconds from the Unix epoch (January 1 1970 00:00:00 GMT) to a given time.). Hereinafter referred to as timestamp.


Returns the timestamp of a certain time.

time();

//Get the timestamp of the current local time.


mktime(hour, minute, second, month, day, year);

//It can be omitted from right to left, and the omitted parameters are replaced with the local time. For example, if the last day and year are omitted, the current time of 22nd 2016 will be used.

//You can write two or four digits for the year. When using two digits, 0-69 corresponds to 2000-2069, and 70-100 corresponds to 1970-2000. The four-digit time test is valid from 1970 to 2037.


date('Y-m-d H:i', $time);

//Get the timestamp of parameter 2 and obtain the string in the format of parameter 1. This is my most commonly used format: 2016-08-22 09:02

//Parameter 1 supports many letter values, such as: s (seconds with leading zeros), M (month with three-letter abbreviation), y (two-digit year), T (time zone where the machine is located) ) Wait and check in the manual.


getdate($timestamp);

//Return a unix timestamp as an array, the default value is the current local time, the return value format is as follows

Array
(
    [seconds] => 40
    [minutes] => 58
    [hours]   => 9//24小時制的9點
    [mday]    => 22//日期
    [wday]    => 6//禮拜6
    [mon]     => 10//十月
    [year]    => 2016
    [yday]    => 295//今年的第295天
    [weekday] => Saturday//禮拜6
    [month]   => October//十月
    [0]       => 1055901520//時間戳
)

Uh-huh. These are the ones I commonly use.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1488
72