当前位置:首页>php>PHP 时间处理工具全解析

PHP 时间处理工具全解析

  • 2026-01-31 07:05:47
PHP 时间处理工具全解析
下面列出了 PHP 原生时间处理工具和主流第三方时间处理库,将从简介、实例、优缺点、总结汇总四个维度进行全面解析,帮助清晰理解各工具的适用场景。

一、PHP 原生时间处理工具

1. DateTime 类

DateTime是 PHP 5.2+ 的核心可变时间日期类,支持时间的创建、修改、格式化等基础操作,是原生时间处理的核心。其最大特点是可变对象:修改方法直接影响当前对象本身。
<?php// 创建 DateTime 对象$date new DateTime(); // 当前时间$specDate new DateTime('2026-01-18 10:30:00'); // 指定时间// 修改时间$date->modify('+1 day');$date->modify('-2 hours 30 minutes');// 格式化输出echo "修改后的当前时间:" . $date->format('Y-m-d H:i:s') . PHP_EOL;echo "指定时间格式化:" . $specDate->format('Y-m-d') . PHP_EOL;// 计算时间差$interval $date->diff($specDate);echo "时间差:" . $interval->format('%y 年 %m 月 %d 天 %h 小时 %i 分钟') . PHP_EOL;?>

优缺点

  • 优点:原生支持、API 简单、满足大部分基础需求、兼容性好

  • 缺点:对象可变(易引发副作用)、复杂时间计算能力有限、时区需手动处理

2. DateTimeImmutable 类

DateTimeImmutable(PHP 5.5+)为不可变时间日期类,API 与DateTime基本一致。不可变性意味着每次修改都会生成新对象,原对象不会变化,适合多场景复用。
<?php$originalDate new DateTimeImmutable('2026-01-18');echo "原始时间:" . $originalDate->format('Y-m-d') . PHP_EOL;$newDate $originalDate->modify('+7 days');echo "新对象时间(+7天):" . $newDate->format('Y-m-d') . PHP_EOL;echo "原对象时间(未改变):" . $originalDate->format('Y-m-d') . PHP_EOL;$interval $newDate->diff($originalDate);echo "时间差:" . $interval->format('%d 天') . PHP_EOL;?>

优缺点

  • 优点:无副作用、安全复用、API 兼容、原生支持

  • 缺点:PHP 5.5+ 才支持、复杂操作需扩展、性能略低

3. DateTimeZone 类

<?php$shanghaiZone new DateTimeZone('Asia/Shanghai');$newYorkZone new DateTimeZone('America/New_York');$date new DateTime('2026-01-18 12:00:00'$shanghaiZone);echo "上海时间:" . $date->format('Y-m-d H:i:s P') . PHP_EOL;$date->setTimezone($newYorkZone);echo "纽约时间:" . $date->format('Y-m-d H:i:s P') . PHP_EOL;$immutableDate new DateTimeImmutable('2026-01-18 12:00:00'$shanghaiZone);$nyImmutableDate $immutableDate->setTimezone($newYorkZone);echo "不可变对象-纽约时间:" . $nyImmutableDate->format('Y-m-d H:i:s P') . PHP_EOL;?>

优缺点

  • 优点:原生支持、跨时区处理、全球时区、与核心类集成

  • 缺点:仅处理时区、时区标识需规范、无快捷转换

4. date() 函数

date()是 PHP 4+ 的原生格式化函数,将 Unix 时间戳转为指定格式字符串,常用于简单时间展示。
<?phpecho "当前时间格式化:" . date('Y-m-d H:i:s') . PHP_EOL;$timestamp strtotime('2026-01-18');echo "指定时间戳格式化:" . date('Y-m-d'$timestamp) . PHP_EOL;date_default_timezone_set('Asia/Shanghai');echo "指定时区格式化:" . date('Y-m-d H:i:s P') . PHP_EOL;?>

优缺点

  • 优点:简单高效、无对象开销、兼容性强

  • 缺点:仅支持 Unix 时间戳、无复杂计算、功能单一

5. strtotime() 函数

strtotime()(PHP 4+)将人类可读时间字符串转为 Unix 时间戳,常与date()配合。
<?php$timestamp1 strtotime('2026-01-18');echo "标准格式解析:" . $timestamp1 " → " . date('Y-m-d'$timestamp1) . PHP_EOL;$timestamp2 strtotime('+3 days');$timestamp3 strtotime('last Monday'$timestamp1);echo "相对时间(+3天):" . date('Y-m-d'$timestamp2) . PHP_EOL;echo "相对时间(上周一):" . date('Y-m-d'$timestamp3) . PHP_EOL;$invalidTimestamp strtotime('invalid date');var_dump($invalidTimestamp);?>

优缺点

  • 优点:使用简单、支持相对时间、兼容性好

  • 缺点:2038 年问题、对非标准字符串支持差、无时区灵活配置

6. DateInterval 类

DateInterval(PHP 5.3+)表示固定时间跨度,常由DateTime::diff()生成,也可手动创建,用于时间增减。
<?php$date1 new DateTime('2026-01-01');$date2 new DateTime('2026-01-18');$interval $date1->diff($date2);echo "差值间隔:" . $interval->format('%d 天,总秒数:%a 天(累计)') . PHP_EOL;$oneWeekTwoHours new DateInterval('P1WT2H');$threeDays new DateInterval('P3D');$date1->add($oneWeekTwoHours);echo "增加1周2小时后:" . $date1->format('Y-m-d H:i:s') . PHP_EOL;$date2->sub($threeDays);echo "减少3天后:" . $date2->format('Y-m-d H:i:s') . PHP_EOL;?>

优缺点

  • 优点:原生支持、精准表示间隔、与核心类集成

  • 缺点:间隔格式复杂、不支持动态计算、无间隔运算

7. DatePeriod 类

DatePeriod(PHP 5.3+)用于生成重复时间序列,适合定时任务、报表周期等场景。
<?php$start new DateTime('2026-01-01');$interval new DateInterval('P7D');$end new DateTime('2026-01-31');$period new DatePeriod($start$interval$end);echo "2026年1月每周一日期:" . PHP_EOL;foreach($period as $date) {    echo $date->format('Y-m-d') . PHP_EOL;}$period2 new DatePeriod($start$interval4);echo PHP_EOL . "生成5个时间点:" . PHP_EOL;foreach($period2 as $date) {    echo $date->format('Y-m-d') . PHP_EOL;}?>

优缺点

  • 优点:原生支持、生成序列便捷、可遍历

  • 缺点:PHP 5.3+、复杂周期支持有限、依赖其他类

二、PHP 第三方时间处理库

1. nesbot/carbon

Carbon 是最流行的 PHP 时间处理库,基于DateTimeImmutable,提供优雅 API、全面功能、强大本地化,适合绝大多数项目。

安装

composer require nesbot/carbon

实例

<?phprequire 'vendor/autoload.php';use Carbon\Carbon;$now Carbon::now();$specDate Carbon::parse('2026-01-18 10:30:00');$shanghaiDate Carbon::now('Asia/Shanghai');$futureDate $specDate->addDays(7)->subHours(2)->addMinutes(30);echo "计算后时间:" . $futureDate->format('Y-m-d H:i:s') . PHP_EOL;echo "相对当前时间:" . $specDate->diffForHumans() . PHP_EOL;echo "内置格式(ISO):" . $specDate->toIso8601String() . PHP_EOL;echo "自定义格式:" . $specDate->format('Y年m月d日 H时i分') . PHP_EOL;$nyDate $shanghaiDate->tz('America/New_York');echo "纽约时间:" . $nyDate->format('Y-m-d H:i:s P') . PHP_EOL;?>

优缺点

  • 优点:API 优雅、功能全面、原生兼容、本地化、社区活跃

  • 缺点:需 Composer 安装、功能略重、PHP 7.1+ 支持

2. Chronos

Chronos 由 Laravel 团队开发,基于DateTimeImmutable,轻量高效,API 简洁,适合追求性能与简洁的项目。

安装

composer require illuminate/chronos

实例

<?phprequire'vendor/autoload.php';useIlluminate\Support\CarbonasChronos;$now Chronos::now();$specDate Chronos::parse('2026-01-18');$newDate $specDate->addWeeks(2)->subDays(1);echo"计算后时间:" . $newDate->format('Y-m-d H:i:s') . PHP_EOL;echo"相对时间:" . $newDate->diffForHumans() . PHP_EOL;$date Chronos::now('Asia/Shanghai')->tz('UTC');echo"UTC 时间:" . $date->format('Y-m-d H:i:s P') . PHP_EOL;?>

优缺点

  • 优点:轻量高效、API 简洁、Laravel 集成

  • 缺点:需 Composer 安装、功能略少、社区活跃度略低

3. spatie/period

专注于时间段的处理,支持交集、合并、分割等复杂运算,适合预约、账单、考勤等场景。

安装

composer require spatie/period

实例

<?phprequire 'vendor/autoload.php';use Spatie\Period\Period;use Spatie\Period\Unit;$period1 Period::make('2026-01-01''2026-01-10');$period2 Period::make('2026-01-08''2026-01-15');echo "period1 是否包含 2026-01-05:" . ($period1->contains('2026-01-05') ? '是' : '否') . PHP_EOL;echo "period1 与 period2 是否重叠:" . ($period1->overlaps($period2) ? '是' : '否') . PHP_EOL;$intersection $period1->intersection($period2);$merge $period1->merge($period2);echo "交集时间段:" . $intersection->start()->format('Y-m-d') . " 至 " . $intersection->end()->format('Y-m-d') . PHP_EOL;echo "合并后时间段:" . $merge->start()->format('Y-m-d') . " 至 " . $merge->end()->format('Y-m-d') . PHP_EOL;$days $period1->split(Unit::Day);echo "按天分割后的时间段数量:" . count($days) . PHP_EOL;?>

优缺点

  • 优点:专注时间段、API 优雅、运算丰富

  • 缺点:仅处理时间段、PHP 7.4+ 支持、通用性不足

4. brick/date-time

强类型时间处理库,完全独立于 PHP 原生类,强调类型安全和不可变性,适合大型、严谨项目。

安装

composer require brick/date-time

实例

<?phprequire 'vendor/autoload.php';use Brick\DateTime\LocalDate;use Brick\DateTime\LocalDateTime;use Brick\DateTime\TimeZone;use Brick\DateTime\Duration;$localDate LocalDate::of(2026118);$localDateTime LocalDateTime::of(202611810300);$timeZone TimeZone::of('Asia/Shanghai');$duration Duration::ofDays(7)->plusHours(2);$newDateTime $localDateTime->plus($duration);echo "计算后时间:" . $newDateTime->toString() . PHP_EOL;echo "日期格式化:" . $localDate->format('Y年m月d日') . PHP_EOL;echo "时间格式化:" . $localDateTime->format('H:i:s') . PHP_EOL;$zonedDateTime $localDateTime->at($timeZone);$nyZonedDateTime $zonedDateTime->withZone(TimeZone::of('America/New_York'));echo "纽约时间:" . $nyZonedDateTime->toString() . PHP_EOL;?>

优缺点

  • 优点:强类型安全、不可变、独立 API、功能全面

  • 缺点:学习成本高、需 Composer 安装、PHP 7.4+ 支持

5. jenssegers/date

基于 Carbon 的扩展,强化多语言本地化,适合国际化、多语言项目。

安装

composer require jenssegers/date

实例

<?phprequire 'vendor/autoload.php';use Jenssegers\Date\Date;Date::setLocale('zh-CN');$now Date::now();$specDate Date::parse('2026-01-18');echo "本地化相对时间:" . $specDate->diffForHumans() . PHP_EOL;echo "本地化日期:" . $specDate->formatLocalized('%Y年%m月%d日') . PHP_EOL;$newDate $specDate->addMonths(2)->subDays(3);echo "计算后时间:" . $newDate->format('Y-m-d') . PHP_EOL;?>

优缺点

  • 优点:多语言本地化、API 兼容 Carbon、国际化友好

  • 缺点:需 Composer 安装、依赖 Carbon、PHP 7.0+ 支持

6. lcobucci/clock

专注时钟抽象,便于单元测试和统一时钟管理,适合模拟时间场景。

安装

composer require lcobucci/clock

实例

<?phprequire 'vendor/autoload.php';use Lcobucci\Clock\SystemClock;use Lcobucci\Clock\FixedClock;use DateTimeZone;$systemClock new SystemClock(new DateTimeZone('Asia/Shanghai'));$now $systemClock->now();echo "系统当前时间:" . $now->format('Y-m-d H:i:s') . PHP_EOL;$fixedTime new DateTimeImmutable('2026-01-18 10:30:00');$fixedClock new FixedClock($fixedTime);echo "固定时钟时间:" . $fixedClock->now()->format('Y-m-d H:i:s') . PHP_EOL;$offsetClock new class($fixedTimeimplements Lcobucci\Clock\ClockInterface {    private $time;    public function __construct(DateTimeImmutable $time) { $this->time = $time; }    public function now(): DateTimeImmutable { return $this->time->modify('+1 hour'); }};echo "偏移时钟时间(+1小时):" . $offsetClock->now()->format('Y-m-d H:i:s') . PHP_EOL;?>

优缺点

  • 优点:抽象时钟、类型安全、轻量高效、测试友好

  • 缺点:功能单一、需 Composer 安装、PHP 7.4+ 支持

三、总结与汇总

1. 工具分类汇总表

类型

工具名称

核心特点

适用场景

原生时间类(可变)

DateTime

可变对象、基础时间操作、原生支持

简单项目、老旧 PHP 版本、无需复杂时间逻辑

原生时间类(不可变)

DateTimeImmutable

不可变对象、安全复用、API 兼容

复杂逻辑、多场景复用、避免副作用

原生时区类

DateTimeZone

时区管理、集成

跨时区项目、统一时区配置

原生格式化函数

date()

简单高效、格式化时间戳

快速格式化、简单展示

原生解析函数

strtotime()

解析字符串、支持相对时间

简单时间转换

原生时间间隔类

DateInterval

表示跨度、支持差值

时间增减、差值计算

原生时间周期类

DatePeriod

生成序列、可遍历

定时任务、报表周期

第三方主流

nesbot/carbon

优雅 API、功能全面

复杂逻辑、高效开发

第三方轻量

Chronos

轻量高效、兼容 Carbon

Laravel、轻量项目

第三方时间段

spatie/period

专注时间段、运算丰富

预约、账单、考勤

第三方强类型

brick/date-time

强类型、不可变

大型项目、API

第三方本地化

jenssegers/date

多语言本地化

跨境、国际化

第三方时钟抽象

lcobucci/clock

时钟抽象、测试友好

单元测试、统一管理

2. 核心选择建议

  • 快速开发 / 大部分项目:优先选用nesbot/carbon

  • Laravel 项目:推荐Chronos

  • 老旧项目 / 简单需求:使用原生DateTime+date()+strtotime()

  • 复杂逻辑 / 避免副作用:用DateTimeImmutable或brick/date-time

  • 时间段处理:专用spatie/period

  • 单元测试 / 时钟管理:用lcobucci/clock

  • 国际化项目:用jenssegers/date

3. 核心总结

原生工具满足基础需求,第三方库解决复杂场景,二者互补。
不可变对象是复杂项目首选,能有效避免副作用(如DateTimeImmutable、Carbon、Chronos)。
专用库在特定场景下效率高于通用工具,应按需选择。
跨时区项目必须配合时区功能,避免时间偏差。
Unix 时间戳相关工具存在 2038 年问题,长期项目建议慎用。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 03:07:31 HTTP/2.0 GET : https://f.mffb.com.cn/a/466127.html
  2. 运行时间 : 0.358094s [ 吞吐率:2.79req/s ] 内存消耗:4,487.81kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=50413d8938f7eed1d2d8f17df3f8c949
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000875s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001177s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.003007s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.005936s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001100s ]
  6. SELECT * FROM `set` [ RunTime:0.004766s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001403s ]
  8. SELECT * FROM `article` WHERE `id` = 466127 LIMIT 1 [ RunTime:0.027678s ]
  9. UPDATE `article` SET `lasttime` = 1770491251 WHERE `id` = 466127 [ RunTime:0.007584s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.000374s ]
  11. SELECT * FROM `article` WHERE `id` < 466127 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.006518s ]
  12. SELECT * FROM `article` WHERE `id` > 466127 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.021568s ]
  13. SELECT * FROM `article` WHERE `id` < 466127 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.064557s ]
  14. SELECT * FROM `article` WHERE `id` < 466127 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.041471s ]
  15. SELECT * FROM `article` WHERE `id` < 466127 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.043032s ]
0.361174s