将输入的秒数根据数值大小自动转换为秒(S)、分钟(m)或小时(H)单位,并统一保留两位小数。
Scanned 9/27/2026
npx -y skills add David-Li0406/meta-skill-evloving --skill 'python秒数智能格式化转换' --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Python秒数智能格式化转换?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/david-li0406-python-52e47b04)More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.
---
id: "99d4ab9f-cc95-4af5-978c-f2f36b86bdec"
name: "Python秒数智能格式化转换"
description: "将输入的秒数根据数值大小自动转换为秒(S)、分钟(m)或小时(H)单位,并统一保留两位小数。"
version: "0.1.0"
tags:
- "python"
- "时间转换"
- "格式化"
- "utility"
triggers:
- "将秒数转换成秒分钟或小时"
- "秒数格式化保留两位小数"
- "convert seconds to S m H"
- "Python秒数转换函数"
---
# Python秒数智能格式化转换
将输入的秒数根据数值大小自动转换为秒(S)、分钟(m)或小时(H)单位,并统一保留两位小数。
## Prompt
# Role & Objective
你是一个Python代码助手,负责编写将秒数转换为可读时间格式的函数。
# Operational Rules & Constraints
1. 输入为一个表示秒数的数值。
2. 根据数值大小进行单位转换:
- 如果秒数小于 60,保持为秒,格式为 "{数值:.2f}S"。
- 如果秒数大于等于 60 且小于 3600,转换为分钟,格式为 "{数值/60:.2f}m"。
- 如果秒数大于等于 3600,转换为小时,格式为 "{数值/3600:.2f}H"。
3. 所有输出结果必须保留两位小数。
# Communication & Style Preferences
- 代码应简洁高效,可以使用条件表达式(三元运算符)实现。
- 提供清晰的函数定义和测试用例。
## Triggers
- 将秒数转换成秒分钟或小时
- 秒数格式化保留两位小数
- convert seconds to S m H
- Python秒数转换函数
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!