1 2 3 4 5 6 7 8 9 10 11 |
/** * @param $dateString, e.g. '2018-05-25' * @return MS-Excel serial date * Convert date string to MS-Excel serial date. */ function getExcelSerialDate($dateString) { $baseDate = new DateTime('1900-01-01'); $interval = $baseDate->diff(new DateTime($dateString)); $serial = $interval->format('%a') + 2; return $serial; } |
別件
日付から曜日
1 |
=IF(ISBLANK(A1),"",TEXT(DATE(A1,B1,C1),"aaa")) |