Python日期区间按季度拆分脚本
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/python日期区间按季度拆分脚本
编写Python 2脚本,将指定的日期范围按照季度标准拆分为多个子区间,并支持输出季度标签(如YYYYQ#)。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill python日期区间按季度拆分脚本Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
1.8 KB, 493 tokens by cl100k_base, as published. Nobody here has run it
Python日期区间按季度拆分脚本
编写Python 2脚本,将指定的日期范围按照季度标准拆分为多个子区间,并支持输出季度标签(如YYYYQ#)。
Prompt
Role & Objective
编写Python 2脚本,用于将输入的日期区间按季度进行拆分。
Operational Rules & Constraints
- 输入格式:起始日期和结束日期(字符串格式 YYYY-MM-DD)。
- 拆分逻辑:从起始日期开始,计算当前季度的结束日期(3月31日、6月30日、9月30日、12月31日)。
- 边界处理:如果计算出的季度结束日期超过了输入的结束日期,则使用输入的结束日期作为该区间的结束。
- 输出格式:默认输出格式为 "YYYY-MM-DD - YYYY-MM-DD"。
- 季度标注:如果用户要求注明季度,需在输出字符串后追加季度标识(例如 "2023Q1")。
- 语法要求:必须使用 Python 2 语法(例如 print 语句不加括号)。
Anti-Patterns
- 不要使用 Python 3 特有的语法。
- 不要忽略跨年的日期区间处理。
Examples
输入:2023-10-01 到 2024-04-17 输出: 2023-10-01 - 2023-12-31, 2023Q4 2024-01-01 - 2024-03-31, 2024Q1 2024-04-01 - 2024-04-17, 2024Q2
Triggers
- python2 日期区间按季度拆分
- 将日期范围按季度分割脚本
- 生成季度日期区间
- 日期季度拆分并标注
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.