ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
fast\Date /** * 计算两个时区间相差的时长,单位为秒 * @param string $remote timezone that to find the offset of * @param string $local timezone used as the baseline * @param mixed $now UNIX timestamp or date string * @return integer */ offset($remote, $local = NULL, $now = NULL) /** * 计算两个时间戳之间相差的时间 * @param int $remote timestamp to find the span of * @param int $local timestamp to use as the baseline * @param string $output formatting string * @return string when only a single output is requested * @return array associative list of all outputs requested * @from https://github.com/kohana/ohanzee-helpers/blob/master/src/Date.php */ span($remote, $local = NULL, $output = 'years,months,weeks,days,hours,minutes,seconds') /** * 格式化 UNIX 时间戳为人易读的字符串 * * @param int Unix 时间戳 * @param mixed $local 本地时间 * * @return string 格式化的日期字符串 */ human($remote, $local = null) /** * 获取一个基于时间偏移的Unix时间戳 * * @param string $type 时间类型,默认为day,可选minute,hour,day,week,month,quarter,year * @param int $offset 时间偏移量 默认为0,正数表示当前type之后,负数表示当前type之前 * @param string $position 时间的开始或结束,默认为begin,可选前(begin,start,first,front),end * @param int $year 基准年,默认为null,即以当前年为基准 * @param int $month 基准月,默认为null,即以当前月为基准 * @param int $day 基准天,默认为null,即以当前天为基准 * @param int $hour 基准小时,默认为null,即以当前年小时基准 * @param int $minute 基准分钟,默认为null,即以当前分钟为基准 * @return int 处理后的Unix时间戳 */ unixtime($type = 'day', $offset = 0, $position = 'begin', $year = null, $month = null, $day = null, $hour = null, $minute = null)