时间和日期--Python

1. 时间:time模块



markup 复制代码
总结:


2. datetime模块

相比与time模块,datetime模块的接口更直观、更容易调用

2.1 datetime模块定义的类

(1)datetime.date:表示日期的类。常用的属性有:year、month、day;

(2)datetime.time: 表示时间的类。常用的属性有:hour、minute、second、mocrosecond

(3)datetime.datetime 表示日期时间

(4)datetime.timedelta: 表示时间间隔:两个时间点之间的长度

(5)datetime.tzinfo: 与时区相关的信息

相关推荐
aqi001 小时前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能·python·大模型·ai编程·ai应用
金銀銅鐵3 小时前
用 Python 实现 Take-Away 游戏
python·游戏
copyer_xyf3 小时前
Agent 流程编排
后端·python·agent
copyer_xyf4 小时前
Agent RAG
后端·python·agent
copyer_xyf4 小时前
【RAG】向量数据库:milvus
后端·python·agent
copyer_xyf4 小时前
Agent 记忆管理
后端·python·agent
星云穿梭19 小时前
用Python写一个带图形界面的学生管理系统——完整教程
python
金銀銅鐵19 小时前
用 Pygame 实现 15 puzzle
python·数学·游戏
黄忠1 天前
大模型之LangGraph技术体系
python·llm