PHP Excel Reader, Excel time converted to PHP time format

Source: Internet
Author: User
Tags php excel

Recently, I was doing an import function, using the Phpexcel class library in the system, reading the uploaded Excel file, then mapping the fields, and finally importing the data in Excel into the system. Among them, about the date format of the import, make me make a difficult.

First, how to import the date, because the date format in the Phpexcel is obtained by the number, not the date string, so there is a lot of code on the Internet to convert the numbers obtained in Excel into the Unix time used by PHP, in fact, it does not have to be so troublesome. In Phpexcel, there is this method: phpexcel_shared_date::exceltophp ($value). can be used directly.

The resulting results can then be converted into dates using the data function.

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.