PHP localtime () Function Example Tutorial

Source: Internet
Author: User
Tags local time
PHP localtime () Function Example Tutorial
 
 

Definitions and usage
The local time () function returns an array that contains the time component of the Unix timestamp.

Grammar

LocalTime (timestamp,is_associative)
 
    
    
parameter description
timestamp optional. Specifies the date or time is formatted. If no timestamp is specified, it uses the current local time.
is_associative optional 。 Specifies whether to return an array of associations or indexes. If set to False, the array returned is an indexed array. If set to true and then return array is associative array. The associative array of the key is: [Tm_sec]-sec [t m_min]-min [t m _hour]-Hours [TM _ mday]-the first day of one months [tm_ m on]-one months a year (1 = 0) [Tm_year]-life expectancy from 1 900 years Since [t M_wday]-day of the week (Sunday =0) [T M _yday]-Day of the Year [TM _ isdst]-is the effect of daylight saving time
Array
(
[0] =>
[1] => [
2] =>
[3] =>
[4] => 0
[5] => (
6) => 3
[7] =>
[8] => 0
)
Array
(
[tm_sec] => [
tm_min] => [
tm_hour] =>
[tm_mday] =>
[tm_ Mon] => 0
[tm_year] => [
tm_wday] => 3
[tm_yday] =>
[TM_ISDST] => 0
)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.