当前位置:网站首页>PHP excel import time format conversion
PHP excel import time format conversion
2022-04-22 04:08:00 【Orange seven】
1、excel After importing in :excel Time is 2014-5-27 This format , But import php The file is 41986 A string of numbers , terms of settlement :
function excelTime($days, $time=false){
if(is_numeric($days)){
//based on 1900-1-1
$jd = GregorianToJD(1, 1, 1970);
$gregorian = JDToGregorian($jd+intval($days)-25569);
$myDate = explode('/',$gregorian);
$myDateStr = str_pad($myDate[2],4,'0', STR_PAD_LEFT)
."-".str_pad($myDate[0],2,'0', STR_PAD_LEFT)
."-".str_pad($myDate[1],2,'0', STR_PAD_LEFT)
.($time?" 00:00:00":'');
return $myDateStr;
}
return $days;
}
Call is direct excelTime($day);$day by excel Read the time value .
版权声明
本文为[Orange seven]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220402429301.html
边栏推荐
- 染色法判定二分图
- Tensorflow error: returned a result with an error set solution
- Redis persistence
- 01背包问题(二维数组解法以及一位数组优化)
- On the origin of wireless operation and maintenance and project construction
- 高斯分布——在误差测量中的推导
- export ‘createStore‘ (imported as ‘createStore‘) was not found in ‘./store/index.js‘ (possible expor
- Web 安全之 XSS 攻击原理/分类/防御 详解
- Insert a number into the ordered array (Bubble + rand function)
- 2022-04-21:给定一个包含 [0,n) 中不重复整数的黑名单 blacklist, 写一个函数从 [0, n) 中返回一个不在 blacklist 中的随机整数, 对它进行优化使其尽量少调用系
猜你喜欢

js动态生成table表格,加滚动条

English | Day11, 12 x sentence true research daily sentence (meaning group)

. net 20th anniversary learning challenge Net mobile application

Mongodb - $match operation of aggregation pipeline

Im instant messaging development technology: 1-10 million high concurrency architecture evolution

交通行业提升数据利用效率的核心是做好数据交换与共享

Lammps实现结冰匀相成核

【机器学习】长短时记忆网络(LSTM)

Solution of stm32i2c

英语 | Day11、12 x 句句真研每日一句(意思群)
随机推荐
Determination of bipartite graph by coloring method
export ‘createStore‘ (imported as ‘createStore‘) was not found in ‘./store/index.js‘ (possible expor
sumo-绕圈行驶
Anaconda 相关
. net debugging: use visual studio to debug dump files
10-personalized top-N sequential recommendation via revolutionary sequence embedding
Sumo tutorial - Manhattan
LeetCode_矩形_困难_391.完美矩形
Developing grpc application based on well-known micro service framework go micro
MySQL下载
博图监视浮点型变量显示16#7FC0_0000异常
染色法判定二分图
Implement joint type verification of parameters in nest
Class组件详解
交通行業提昇數據利用效率的核心是做好數據交換與共享
SeNet || 注意力机制——源代码+注释
Lammps实现结冰匀相成核
英特尔边缘软件中心介绍
Facing opportunities and challenges in the development of smart watches
Applet about subcontracting