Skip to main content

日期时间

Datetime 是一种用于引用日期和时间的数据类型。

💡 常用日期时间 Usage

例如,datetime 属性类型可被用来存储任何日期和时间:

  • 部署时间
  • 发布时间
  • 最后事件日期
  • 创建时间戳

live demo 这个示例中,我们可以看到 "最后更新 "日期时间属性。

应用程序接口定义

{
"myDatetimeProp": {
"title": "My datetime",
"icon": "My icon",
"description": "My datetime property",
"type": "string",
"format": "date-time",
"default": "2022-04-18T11:44:15.345Z"
}
}

Check out Port's API reference to learn more.

Terraform 定义

resource "port_blueprint" "myBlueprint" {
# ...blueprint properties
properties = {
string_props = {
"myDatetimeProp" = {
title = "My datetime"
icon = "My icon"
description = "My datetime property"
format = "date-time"
default = "2022-04-18T11:44:15.345Z"
}
}
}
}

Pulumi 的定义

"""A Python Pulumi program"""

import pulumi
from port_pulumi import Blueprint,BlueprintPropertiesArgs,BlueprintPropertiesStringPropsArgs

blueprint = Blueprint(
"myBlueprint",
identifier="myBlueprint",
title="My Blueprint",
properties=BlueprintPropertiesArgs(
string_props={
"myDatetimeProp": BlueprintPropertiesStringPropsArgs(
title="My email",
format="date-time",
Required=True,
)
}
),
relations={},
)