Example of php reading excel date data

Source: Internet
Author: User
The date in Excel, after being read by php, is converted into a number similar to 25569, instead of the 1970-1-1 character format displayed in Excel. the date in the original excel is a number format starting from-1, for example, 1900-1 -... the date in Excel, after being read by php, is converted into a number similar to 25569, instead of the 1970-1-1 character format displayed in Excel. the date in the original excel is a number format starting from-1, for example, if 25569-1-1 is 1,-1-1 is.

Provides a read function with the following code:

 25568? $ Date + 1: 25569;/* There was a bug if Converting date before 1-1-1970 (tstamp 0) */$ ofs = (70*365 + 17 + 2) * 86400; $ date = date ("Y-m-d", ($ date * 86400)-$ ofs ). ($ time? "00:00:00": '');} return $ date ;}


Article link:

Save this article for favorites!

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.