> For the complete documentation index, see llms.txt.
Skip to main content

Check out Port for yourself ➜ 

Datetime

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

Common usage​

Use date & time properties to record timestamps from your tools, such as:

  • The latest successful deployment.
  • The start and resolution times of an incident.
  • A certificate expiration date.
  • The latest security scan.

Port already tracks entity creation and update times in meta-properties. Use a timer when a deadline should emit a timer-expired event.

Display format​

By default, Port displays datetime values relative to the current time (e.g., "3 months ago"). Use the optional date_format field to override this - for example, to show exact timestamps for audit logs, or to match your team's locale conventions. The following formats are supported:

  • relative - Relative to the current time, e.g., "3 months ago" (default).
  • 12-hour - 12-hour clock, US convention, e.g., "Nov 26, 2025, 8:50 PM".
  • 24-hour - 24-hour clock, international convention, e.g., "26 Nov 2025 20:50".
  • YYYY-MM-DD HH:mm - Fixed ISO-like format, e.g., "2025-11-26 20:50".

API definition​

Use the date_format field to control how the value is displayed in the UI. See display format for supported values.

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

Check out Port's API reference to learn more.

Terraform definition​

The examples below use version 2.29.0 of the Terraform and Pulumi providers. Configure your provider first, then run one example at a time in its own project. Each example creates a blueprint; use distinct identifiers when you combine examples.

Use the date_format field to control how the value is displayed in the UI. See display format for supported values.

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

Pulumi definition​

Use dateFormat in TypeScript and JavaScript, date_format in Python, and DateFormat in Go. Version 2.29.0 exposes this setting for scalar string properties; array items support format: "date-time" without a display-format setting in these providers.

Use the date_format field to control how the value is displayed in the UI. See display format for supported values.

"""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 datetime",
format="date-time",
date_format="12-hour",
required=True,
)
}
),
relations={},
)