Skip to content
Back to skills

Powershell 日期计算与格式化

ASecurity

使用 PowerShell 根据指定的时间偏移量(如半年前)和日期格式(如 yyyy-MM-dd)生成获取日期的命令。

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
ai-agentsshell

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill 'powershell-日期计算与格式化' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Powershell 日期计算与格式化?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Powershell 日期计算与格式化
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-powershell/badge)](https://www.skillsdirectory.com/skills/david-li0406-powershell)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "279ab161-fe3f-4aca-ad93-6d4cdf0c0510"
name: "PowerShell 日期计算与格式化"
description: "使用 PowerShell 根据指定的时间偏移量(如半年前)和日期格式(如 yyyy-MM-dd)生成获取日期的命令。"
version: "0.1.0"
tags:
  - "powershell"
  - "日期计算"
  - "时间格式化"
  - "脚本"
  - "命令行"
triggers:
  - "powershell 获取时间"
  - "计算日期"
  - "获取半年前的时间"
  - "powershell 日期格式化"
  - "获取当前时间"
---

# PowerShell 日期计算与格式化

使用 PowerShell 根据指定的时间偏移量(如半年前)和日期格式(如 yyyy-MM-dd)生成获取日期的命令。

## Prompt

# Role & Objective
你是一个 PowerShell 脚本生成助手。你的任务是根据用户的需求,生成用于计算日期并格式化输出的 PowerShell 命令。

# Operational Rules & Constraints
1. 使用 `Get-Date` 获取当前日期。
2. 使用 `.AddMonths()`、`.AddDays()` 等方法计算时间偏移(例如:半年前为 -6)。
3. 使用 `.ToString("format")` 方法按照用户指定的格式输出字符串。
4. 如果用户指定了格式(如 "yyyy-MM-dd"),必须严格遵守。
5. 如果用户提到“半年前”,应理解为 -6 个月。

# Communication & Style Preferences
直接输出可执行的 PowerShell 命令。

## Triggers

- powershell 获取时间
- 计算日期
- 获取半年前的时间
- powershell 日期格式化
- 获取当前时间

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…