- 广场
-
- 搜索中...
- 本文档内搜索
zxf/tools 使用手册
Date 时间处理
use zxf\Tools\DateTools;
得到某天凌晨零点的时间戳
// today 今天(默认)
// yesterday 昨天
// tomorrow 明天
// month_first 本月第一天
// year_first 今年第一天
// 2017-01-01、2017-01-01 09:10:40、-1days、+1days、+1month、+1year 等
DateTools::getSomeZeroTimeStamp($str = 'today')
友好时间显示
// $time: 时间戳或能被 strtotime 解析的字符串
DateTools::get_friend_date(string $time)
获取当前时间的前n天
DateTools::getLastDays(int $day = 7)
获取指定时间是星期几
// $time: 时间戳或能被 strtotime 解析的字符串
DateTools::getWeekDay(string $time)
获取指定时间的月份
// $time: 时间戳或能被 strtotime 解析的字符串
DateTools::getMonth(string $time)