Skip to main content
The DateTime component allows users to select dates and optionally times.

Basic usage

Constructor

float | str | datetime | None
default:"None"
Default datetime value
bool
default:"True"
Whether to include time selection. If False, only date is selectable
Literal['timestamp', 'datetime', 'string']
default:"'timestamp'"
Return format:
  • "timestamp" - Unix timestamp (seconds since epoch)
  • "datetime" - Python datetime object
  • "string" - Formatted string
str | None
default:"None"
Timezone (e.g., “US/Pacific”, “Europe/Paris”). If None, uses local timezone
str | None
default:"None"
Label displayed above component
bool | None
default:"None"
Whether datetime can be changed

Events

  • change - Triggered when datetime changes
  • submit - Triggered when datetime is submitted

Examples

Date only

With timezone

Return as datetime object