GuardMarket

datetime.date_parts

分解日期

Return calendar fields, ISO weekday (Monday=1), ISO week/year and day of year.

Version 1.0.0确定性数据处理Backend required

使用场景 / Purpose

Datetime: date parts. 本技能对提供的参数执行计算,输入输出契约如下。文档例子来自已实现函数的固定验收样例;网页本身不执行代码。

输入字段 / Parameters

字段类型要求约束与说明
date"string"必填 Required{"minLength": 10, "maxLength": 10}

输入例子 / Example input

{
  "date": "2024-02-29"
}

预期输出 / Expected output

{
  "year": 2024,
  "month": 2,
  "day": 29,
  "weekday": 4,
  "day_of_year": 60,
  "iso_week": 9,
  "iso_year": 2024
}
完整输入 JSON Schema
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "minLength": 10,
      "maxLength": 10
    }
  },
  "required": [
    "date"
  ],
  "additionalProperties": false,
  "maxProperties": 1000
}
完整输出 JSON Schema
{
  "type": "object",
  "properties": {
    "year": {
      "type": "number",
      "minimum": -1e+100,
      "maximum": 1e+100
    },
    "month": {
      "type": "number",
      "minimum": -1e+100,
      "maximum": 1e+100
    },
    "day": {
      "type": "number",
      "minimum": -1e+100,
      "maximum": 1e+100
    },
    "weekday": {
      "type": "number",
      "minimum": -1e+100,
      "maximum": 1e+100
    },
    "day_of_year": {
      "type": "number",
      "minimum": -1e+100,
      "maximum": 1e+100
    },
    "iso_week": {
      "type": "number",
      "minimum": -1e+100,
      "maximum": 1e+100
    },
    "iso_year": {
      "type": "number",
      "minimum": -1e+100,
      "maximum": 1e+100
    }
  },
  "required": [
    "year",
    "month",
    "day",
    "weekday",
    "day_of_year",
    "iso_week",
    "iso_year"
  ],
  "additionalProperties": false,
  "maxProperties": 1000
}