📜  php代码示例中的excel日期格式

📅  最后修改于: 2022-03-11 14:54:20.428000             🧑  作者: Mango

代码示例1
Please use this formula to change from Excel date to Unix date, then you can 
use "gmdate" to get the real date in PHP:

UNIX_DATE = (EXCEL_DATE - 25569) * 86400
  
and to convert from Unix date to Excel date, use this formula:

EXCEL_DATE = 25569 + (UNIX_DATE / 86400)

After putting this formula into a variable, you can get the real date in PHP 
using this example:

$UNIX_DATE = ($EXCEL_DATE - 25569) * 86400;
echo gmdate("d-m-Y H:i:s", $UNIX_DATE);