Skip to main content

Datetime

Datetime is a data type used to reference a date and time.

💡 Common datetime usage

The datetime property type can be used to store any date and time, for example:

  • Deployment time
  • Release time
  • Last incident date
  • Creation timestamp

In this live demo example, we can see the Last Update datetime property. 🎬

API definition

{
"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 definition

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 definition

"""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={},
)