Skip to main content
Ctrl+K

caput v25.3.1.post103+git.c9762dd5

  • User Guide
  • Installation
  • API Reference
  • GitHub
  • User Guide
  • Installation
  • API Reference
  • GitHub

Section Navigation

  • caput.algorithms
  • caput.astro
    • caput.astro.constants
    • caput.astro.coordinates
    • caput.astro.observer
    • caput.astro.skyfield
    • caput.astro.time
      • datetime_to_timestr
      • datetime_to_unix
      • ensure_unix
      • era_to_unix
      • leap_seconds_between
      • naive_datetime_to_utc
      • time_of_day
      • timestr_to_datetime
      • unix_to_datetime
      • unix_to_era
  • caput.config
  • caput.containers
  • caput.memdata
  • caput.mpiarray
  • caput.pipeline
  • caput.util
  • caput
  • caput.astro
  • caput.astro.time
  • datetime_to_timestr

datetime_to_timestr#

caput.astro.time.datetime_to_timestr(dt)[source]#

Converts a datetime to “YYYYMMDDTHHMMSSZ” format.

Partial seconds are ignored.

Parameters:
dtdatetime | array_like

datetime object to convert to timestring

Returns:
timestrstr | array_like

String representation of the datetime.

See also

timestr_to_datetime()

previous

caput.astro.time

next

datetime_to_unix

On this page
  • caput.astro.time.datetime_to_timestr()

© Copyright 2013-2026 Liam Gray, Kiyoshi Masui and J. Richard Shaw.

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.16.1.