[lib: datetime] Updation of a `datetime` object with a `timedelta` obj reflects the change in the `datetime` object but is not reflected in the value returned by the `timetuple()` function
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
- 领域
- embedded-iot
调研方向
首先,在 Raspberry Pi Pico 上使用 MicroPython v1.23.0 和通过 mip 安装的 datetime 库复现发现代码。检查该软件包使用的 datetime 实现,并验证在添加 timedelta 后,timetuple() 报告的是更新后的 datetime 值。
由索引模型根据 Issue 内容生成。
描述
--- MicroPython v1.23.0 on 2024-06-02; Raspberry Pi Pico with RP2040 ---
-- Datetime library installed via mip (mpremote) so: mpremote mip install datetime
Discovery code:
>>> from datetime import datetime, timedelta
>>> from utime import time, localtime, mktime
>>> interval_s = 5 * 60
>>> intervals_passed_in_hr = total_seconds_this_hr // interval_s
>>> next_interval_seconds_in_hr = (intervals_passed_in_hr + 1) * interval_s
>>> seconds_to_next_interval = next_interval_seconds_in_hr - total_seconds_this_hr
>>> next_record_time_dt = now + timedelta(seconds=seconds_to_next_interval)
>>> now
datetime.datetime(2024, 8, 21, 14, 53, 39, 0, None, fold=0)
>>> next_record_time_dt
datetime.datetime(2024, 8, 21, 14, 55, 0, 0, None, fold=0)
>>> next_record_time_dt.timetuple()[:-2]
(2024, 8, 21, 14, 53, 52)
- 主要语言
- Python
- 星标
- 2.9k
- 派生
- 1.1k
- 平均合并
- 7 天 6 小时
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
micropython/micropython-lib 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
micropython/micropython-lib#1074 ·
-
needs-info
难度 1/5 1 小时以内 新手友好度 72/100
micropython/micropython-lib#943 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
micropython/micropython-lib#931 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 62/100
micropython/micropython-lib#795 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
micropython/micropython-lib#762 ·
查看 micropython/micropython-lib 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main 未关闭area: ci bug perceived difficulty: 3
难度 2/5 1-3 小时 新手友好度 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
-
难度 2/5 1-3 小时 新手友好度 78/100
ClickHouse/clickhouse-connect#1057 ·