跳到正文
TakoAPI
返回技能列表

cst-time

由 xuanpass 提供

Coding Agents & IDEs
624下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Provides methods and tools for obtaining local host CST (China Standard Time)

描述

该技能的功能

Covers methods for obtaining and working with China Standard Time (CST, UTC+8) across Windows, Linux, macOS, and multiple programming languages including Python, JavaScript, Java, Go, and C#. Includes time zone conversion formulas, formatting patterns, and scheduling examples. CST does not observe daylight saving time, which simplifies year-round handling.

Because CST does not observe daylight saving time, using the Asia/Shanghai IANA identifier works reliably year-round without the seasonal offset adjustments that cause bugs with many other timezone conversions.

何时使用

  • Scheduling a cron job to fire at 9 AM Beijing business hours
  • Logging distributed server events with consistent CST timestamps
  • Converting user-submitted timestamps from EST or PST to CST
  • Displaying a live CST clock in a web application for Chinese users
  • Syncing API calls with Chinese market operating hours

示例工作流

输入

User asks: Get the current time in China Standard Time using Python

智能体
  1. 1

    Import pytz and datetime libraries

  2. 2

    Create a timezone object using 'Asia/Shanghai'

  3. 3

    Call datetime.now() with the CST timezone applied

  4. 4

    Format the result as YYYY-MM-DD HH:mm:ss

  5. 5

    Print the formatted CST timestamp

输出

A Python snippet that prints the current CST time, e.g. '2026-03-19 14:30:00'

前置要求

  • TimezoneDB API key (required only for TimezoneDB online API method)
  • Google Maps API key (required only for Google Maps Time Zone API method)

安装

clawhub install xuanpass/cst-time

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接