hypervix/excel-date-converter
Composer 安装命令:
composer require hypervix/excel-date-converter
包简介
Excel Date Converter is a PHP utility package for handling and converting Excel-style date values as well as standard date formats.
README 文档
README
Excel Date Converter is a PHP utility package for handling and converting Excel-style date values as well as standard date formats. This package supports multiple date formats, including timestamps, and provides functionality to parse, convert, and format dates easily.
Features
- Convert Excel-style serial date values to standard UNIX timestamps.
- Support for a wide range of standard date formats.
- Format dates into custom string representations.
- Easy to use and integrate into any PHP project.
Installation
To use this package, you can install it via Composer:
composer require hypervix/excel-date-converter
Usage
require('vendor/autoload.php');
use Hypervix\ExeclDateConverter\ExeclDateConverter;
// Convert Excel serial date to timestamp
$dateConverter = ExeclDateConverter::date(44561);
echo $dateConverter->format('Y-m-d'); // Output: 2022-01-01
// Convert a standard date format
$dateConverter = ExeclDateConverter::date('31-12-2023');
echo $dateConverter->format('Y/m/d'); // Output: 2023/12/31
Supported Date Formats
This package supports the following date formats:
- d-m-Y (e.g., 31-12-2023)
- Y-m-d (e.g., 2023-12-31)
- Y/m/d (e.g., 2023/12/31)
- d/m/Y (e.g., 31/12/2023)
- M d, Y (e.g., Dec 31, 2023)
- d F Y (e.g., 31 December 2023)
- And many more!
For the full list of supported formats, refer to the source code in the ExeclDateConverter::possible_format() method.
Requirements
- PHP >= 7.4
- Composer for installation
Contributing
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes.
- Push your branch and open a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
- Author: Jayanta Bhunia
- Website: https://hypervix.com/
- Email: bhuniajayant@gmail.com
hypervix/excel-date-converter 适用场景与选型建议
hypervix/excel-date-converter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 11 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 hypervix/excel-date-converter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hypervix/excel-date-converter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-25