PHPExcel读取excel中的日期返回数字的解决办法
使用PHPExcel读取excel中的数据,其中日期都转换成了一组纯数字,刚开始以为是乱码导致,后来仔细检查了编码没问题。 百度了一下发现原来excel中表示日期的文本格式确实一组纯数字,而且这个纯数字就是一个偏移的值。这个偏移的值是距离1...
使用PHPExcel读取excel中的数据,其中日期都转换成了一组纯数字,刚开始以为是乱码导致,后来仔细检查了编码没问题。 百度了一下发现原来excel中表示日期的文本格式确实一组纯数字,而且这个纯数字就是一个偏移的值。这个偏移的值是距离1...

//当subday=7的时候调用7天内得所有文章 if($subday > 0) { if($subday == 1) { $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $orwheres[] = " arc.senddate > $limitday "; } else if ($subday == 2) { $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $lomitday = $ntime; $orwheres[] = " arc.senddate > $lomitday && arc.senddate < $limitday"; } else if ($subday == 3) { $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y')); $limitday = $ntime -($subday * 24 * 3600)+(1*24 * 3600); $orwheres[] = " arc.senddate < $limitday "; } else if ($subday == 7) { $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $orwheres[] = " arc.senddate > $limitday "; } } }