当前位置:首页>python>18_Python数据分析:时间差 (Timedelta)

18_Python数据分析:时间差 (Timedelta)

  • 2026-06-28 17:27:38
18_Python数据分析:时间差 (Timedelta)

Python数据分析:时间差 (Timedelta)

1. 核心知识点概述

Timedelta表示两个时间之间的差值,是时间序列分析中的重要概念:

  • Timedelta
    : 表示时间间隔,如2天、3小时等。
  • to_timedelta()
    : 将字符串或数字转换为Timedelta。
  • 时间差运算
    : 支持加减乘除等运算。
  • 频率转换
    : 在不同时间单位间转换。

关键参数说明

  • days
    : 天数。
  • hours
    : 小时数。
  • minutes
    : 分钟数。
  • seconds
    : 秒数。
  • unit
    : 转换时的单位指定。

2. 示例代码

2.1 准备数据

In [1]:

import pandas as pd
import numpy as np
from datetime import datetime, timedelta
print("Pandas Timedelta功能演示")
print("=" * 40)
Pandas Timedelta功能演示
========================================

2.2 创建Timedelta

多种方式创建时间差对象。

In [2]:

# 使用字符串创建
td1 = pd.Timedelta('2 days')
td2 = pd.Timedelta('1 days 2 hours 30 minutes')
td3 = pd.Timedelta('3W')  # 3周
print("使用字符串创建Timedelta:")
print(f"2天: {td1}")
print(f"1天2小时30分: {td2}")
print(f"3周: {td3}")
# 使用关键字参数创建
td4 = pd.Timedelta(days=5, hours=3, minutes=30)
td5 = pd.Timedelta(weeks=2, days=1)
print("\n使用关键字参数创建:")
print(f"5天3小时30分: {td4}")
print(f"2周1天: {td5}")
# 使用to_timedelta批量转换
td_list = pd.to_timedelta(['1 days', '2 days', '3 days', '4 days'])
print("\n批量转换:")
print(td_list)
使用字符串创建Timedelta:
2天: 2 days 00:00:00
1天2小时30分: 1 days 02:30:00
3周: 21 days 00:00:00
使用关键字参数创建:
5天3小时30分: 5 days 03:30:00
2周1天: 15 days 00:00:00
批量转换:
TimedeltaIndex(['1 days', '2 days', '3 days', '4 days'], dtype='timedelta64[ns]', freq=None)

2.3 Timedelta属性

获取时间差的各个组成部分。

In [3]:

td = pd.Timedelta(days=5, hours=3, minutes=30, seconds=45)
print(f"Timedelta: {td}")
print(f"\n各组成部分:")
print(f"总天数: {td.days}")
print(f"总秒数: {td.total_seconds()}")
print(f"总小时数: {td.total_seconds() / 3600:.2f}")
# 使用components获取详细分解
print(f"\n详细分解:")
print(f"components: {td.components}")
print(f"天数: {td.components.days}")
print(f"小时: {td.components.hours}")
print(f"分钟: {td.components.minutes}")
print(f"秒: {td.components.seconds}")
# 使用属性访问
print(f"\n属性访问:")
print(f"to_timedelta64: {td.to_timedelta64()}")  # numpy timedelta64
print(f"value: {td.value}")  # 纳秒数
Timedelta: 5 days 03:30:45
各组成部分:
总天数: 5
总秒数: 444645.0
总小时数: 123.51
详细分解:
components: Components(days=5, hours=3, minutes=30, seconds=45, milliseconds=0, microseconds=0, nanoseconds=0)
天数: 5
小时: 3
分钟: 30
秒: 45
属性访问:
to_timedelta64: 444645000000000 nanoseconds
value: 444645000000000

2.4 Timedelta运算

时间差支持各种数学运算。

In [4]:

td1 = pd.Timedelta(days=2)
td2 = pd.Timedelta(days=1, hours=12)
print(f"td1: {td1}")
print(f"td2: {td2}")
# 加减运算
print(f"\n加减运算:")
print(f"td1 + td2: {td1 + td2}")
print(f"td1 - td2: {td1 - td2}")
# 乘除运算
print(f"\n乘除运算:")
print(f"td1 * 2: {td1 * 2}")
print(f"td1 / 2: {td1 / 2}")
print(f"td1 / td2: {td1 / td2:.2f}")  # 比值
# 取绝对值
td_neg = pd.Timedelta(days=-3)
print(f"\n绝对值:")
print(f"原始: {td_neg}")
print(f"abs: {abs(td_neg)}")
td1: 2 days 00:00:00
td2: 1 days 12:00:00
加减运算:
td1 + td2: 3 days 12:00:00
td1 - td2: 0 days 12:00:00
乘除运算:
td1 * 2: 4 days 00:00:00
td1 / 2: 1 days 00:00:00
td1 / td2: 1.33
绝对值:
原始: -3 days +00:00:00
abs: 3 days 00:00:00

2.5 时间戳与Timedelta运算

时间戳加减时间差得到新的时间戳。

In [5]:

ts = pd.Timestamp('2024-03-15 10:00:00')
td = pd.Timedelta(days=3, hours=5)
print(f"原始时间戳: {ts}")
print(f"时间差: {td}")
# 加减运算
print(f"\n时间运算:")
print(f"ts + td: {ts + td}")
print(f"ts - td: {ts - td}")
# 两个时间戳相减得到Timedelta
ts1 = pd.Timestamp('2024-03-15')
ts2 = pd.Timestamp('2024-03-20')
diff = ts2 - ts1
print(f"\nts1: {ts1}")
print(f"ts2: {ts2}")
print(f"ts2 - ts1: {diff}")
print(f"相差天数: {diff.days}")
原始时间戳: 2024-03-15 10:00:00
时间差: 3 days 05:00:00
时间运算:
ts + td: 2024-03-18 15:00:00
ts - td: 2024-03-12 05:00:00
ts1: 2024-03-15 00:00:00
ts2: 2024-03-20 00:00:00
ts2 - ts1: 5 days 00:00:00
相差天数: 5

2.6 Series中的Timedelta

处理包含时间差的Series。

In [6]:

# 创建Timedelta Series
td_series = pd.Series([
    pd.Timedelta(days=1),
    pd.Timedelta(days=2),
    pd.Timedelta(days=3),
    pd.Timedelta(days=4),
    pd.Timedelta(days=5)
])
print("Timedelta Series:")
print(td_series)
# 转换为天数
days = td_series.dt.days
print(f"\n转换为天数:")
print(days)
# 转换为总秒数
seconds = td_series.dt.total_seconds()
print(f"\n转换为总秒数:")
print(seconds)
# 转换为小时
hours = td_series.dt.total_seconds() / 3600
print(f"\n转换为小时:")
print(hours)
Timedelta Series:
0   1 days
1   2 days
2   3 days
3   4 days
4   5 days
dtype: timedelta64[ns]
转换为天数:
0    1
1    2
2    3
3    4
4    5
dtype: int64
转换为总秒数:
0     86400.0
1    172800.0
2    259200.0
3    345600.0
4    432000.0
dtype: float64
转换为小时:
0     24.0
1     48.0
2     72.0
3     96.0
4    120.0
dtype: float64

2.7 实际应用:计算时间间隔

计算事件发生的时间间隔。

In [7]:

# 创建订单数据
orders = pd.DataFrame({
    'order_id': ['A001', 'A002', 'A003', 'A004', 'A005'],
    'order_time': pd.to_datetime(['2024-03-15 09:00', '2024-03-15 10:30', 
                                  '2024-03-15 14:00', '2024-03-15 16:30', 
                                  '2024-03-16 09:00']),
    'delivery_time': pd.to_datetime(['2024-03-15 11:30', '2024-03-15 13:00', 
                                     '2024-03-15 17:00', '2024-03-15 19:00', 
                                     '2024-03-16 12:00'])
})
# 计算配送时间
orders['delivery_duration'] = orders['delivery_time'] - orders['order_time']
print("订单配送时间:")
print(orders)
# 统计配送时间
print(f"\n配送时间统计:")
print(f"平均配送时间: {orders['delivery_duration'].mean()}")
print(f"最短配送时间: {orders['delivery_duration'].min()}")
print(f"最长配送时间: {orders['delivery_duration'].max()}")
# 转换为小时
orders['delivery_hours'] = orders['delivery_duration'].dt.total_seconds() / 3600
print(f"\n配送时间(小时):")
print(orders[['order_id', 'delivery_hours']])
订单配送时间:
  order_id          order_time       delivery_time delivery_duration
0     A001 2024-03-15 09:00:00 2024-03-15 11:30:00   0 days 02:30:00
1     A002 2024-03-15 10:30:00 2024-03-15 13:00:00   0 days 02:30:00
2     A003 2024-03-15 14:00:00 2024-03-15 17:00:00   0 days 03:00:00
3     A004 2024-03-15 16:30:00 2024-03-15 19:00:00   0 days 02:30:00
4     A005 2024-03-16 09:00:00 2024-03-16 12:00:00   0 days 03:00:00
配送时间统计:
平均配送时间: 0 days 02:42:00
最短配送时间: 0 days 02:30:00
最长配送时间: 0 days 03:00:00
配送时间(小时):
  order_id  delivery_hours
0     A001             2.5
1     A002             2.5
2     A003             3.0
3     A004             2.5
4     A005             3.0

2.8 实际应用:用户留存分析

计算用户两次登录之间的时间间隔。

In [8]:

# 创建用户登录数据
logins = pd.DataFrame({
    'user_id': ['U001', 'U001', 'U001', 'U002', 'U002', 'U003', 'U003', 'U003', 'U003'],
    'login_time': pd.to_datetime([
        '2024-03-01', '2024-03-05', '2024-03-15',
        '2024-03-02', '2024-03-10',
        '2024-03-01', '2024-03-03', '2024-03-07', '2024-03-20'
    ])
})
# 按用户排序
logins = logins.sort_values(['user_id', 'login_time'])
# 计算相邻登录间隔
logins['days_since_last'] = logins.groupby('user_id')['login_time'].diff()
print("用户登录间隔:")
print(logins)
# 统计每个用户的平均登录间隔
avg_interval = logins.groupby('user_id')['days_since_last'].mean()
print(f"\n平均登录间隔:")
for user, interval in avg_interval.items():
    if pd.notna(interval):
        print(f"{user}: {interval.days}天")
用户登录间隔:
  user_id login_time days_since_last
0    U001 2024-03-01             NaT
1    U001 2024-03-05          4 days
2    U001 2024-03-15         10 days
3    U002 2024-03-02             NaT
4    U002 2024-03-10          8 days
5    U003 2024-03-01             NaT
6    U003 2024-03-03          2 days
7    U003 2024-03-07          4 days
8    U003 2024-03-20         13 days
平均登录间隔:
U001: 7天
U002: 8天
U003: 6天

2.9 频率转换

将Timedelta转换为不同的时间单位。

In [9]:

td = pd.Timedelta(days=2, hours=5, minutes=30, seconds=45)
print(f"原始Timedelta: {td}")
print(f"\n频率转换:")
print(f"总天数: {td.total_seconds() / 86400:.4f}天")
print(f"总小时: {td.total_seconds() / 3600:.4f}小时")
print(f"总分钟: {td.total_seconds() / 60:.2f}分钟")
print(f"总秒数: {td.total_seconds()}秒")
print(f"总毫秒: {td.total_seconds() * 1000}毫秒")
# 使用floor/ceil/round
print(f"\n取整操作:")
print(f"floor('D'): {td.floor('D')}")  # 向下取整到天
print(f"ceil('h'): {td.ceil('h')}")    # 向上取整到小时
print(f"round('h'): {td.round('h')}")  # 四舍五入到小时
原始Timedelta: 2 days 05:30:45
频率转换:
总天数: 2.2297天
总小时: 53.5125小时
总分钟: 3210.75分钟
总秒数: 192645.0秒
总毫秒: 192645000.0毫秒
取整操作:
floor('D'): 2 days 00:00:00
ceil('h'): 2 days 06:00:00
round('h'): 2 days 06:00:00

2.10 TimedeltaIndex

使用Timedelta作为索引。

In [10]:

# 创建TimedeltaIndex
td_index = pd.timedelta_range(start='0 days', end='10 days', freq='1D')
print("TimedeltaIndex:")
print(td_index)
# 创建Series
td_series = pd.Series(range(len(td_index)), index=td_index)
print(f"\n使用TimedeltaIndex的Series:")
print(td_series)
# 按时间范围筛选
filtered = td_series['2 days':'5 days']
print(f"\n筛选2-5天的数据:")
print(filtered)
# 创建等差时间序列
td_range = pd.timedelta_range(start='0 hours', periods=12, freq='2h')
print(f"\n每2小时的TimedeltaIndex:")
print(td_range)
TimedeltaIndex:
TimedeltaIndex([ '0 days',  '1 days',  '2 days',  '3 days',  '4 days',
                 '5 days',  '6 days',  '7 days',  '8 days',  '9 days',
                '10 days'],
               dtype='timedelta64[ns]', freq='D')
使用TimedeltaIndex的Series:
0 days      0
1 days      1
2 days      2
3 days      3
4 days      4
5 days      5
6 days      6
7 days      7
8 days      8
9 days      9
10 days    10
Freq: D, dtype: int64
筛选2-5天的数据:
2 days    2
3 days    3
4 days    4
5 days    5
Freq: D, dtype: int64
每2小时的TimedeltaIndex:
TimedeltaIndex(['0 days 00:00:00', '0 days 02:00:00', '0 days 04:00:00',
                '0 days 06:00:00', '0 days 08:00:00', '0 days 10:00:00',
                '0 days 12:00:00', '0 days 14:00:00', '0 days 16:00:00',
                '0 days 18:00:00', '0 days 20:00:00', '0 days 22:00:00'],
               dtype='timedelta64[ns]', freq='2h')

3. 常见应用场景总结

  1. 配送时间分析
    :计算订单从下单到送达的时间。
  2. 用户行为分析
    :计算用户两次操作之间的时间间隔。
  3. 设备运行时间
    :计算设备开机到关机的运行时长。
  4. ** SLA监控**:计算服务响应时间是否在SLA范围内。
  5. 会话时长
    :计算用户在线会话的持续时间。
  6. 任务调度
    :计算下次执行时间与当前时间的差值。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 08:27:36 HTTP/2.0 GET : https://f.mffb.com.cn/a/487186.html
  2. 运行时间 : 0.312209s [ 吞吐率:3.20req/s ] 内存消耗:4,369.25kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=e81d4338b7c7af89841332418070e6a0
  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.000436s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000596s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000984s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.008817s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000666s ]
  6. SELECT * FROM `set` [ RunTime:0.000250s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000598s ]
  8. SELECT * FROM `article` WHERE `id` = 487186 LIMIT 1 [ RunTime:0.011111s ]
  9. UPDATE `article` SET `lasttime` = 1783038456 WHERE `id` = 487186 [ RunTime:0.004909s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.005268s ]
  11. SELECT * FROM `article` WHERE `id` < 487186 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.006255s ]
  12. SELECT * FROM `article` WHERE `id` > 487186 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.042485s ]
  13. SELECT * FROM `article` WHERE `id` < 487186 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.040656s ]
  14. SELECT * FROM `article` WHERE `id` < 487186 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.068131s ]
  15. SELECT * FROM `article` WHERE `id` < 487186 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.029721s ]
0.313724s