gcloud beta topic datetimes

NAME
gcloud beta topic datetimes - date/time input format supplementary help
DESCRIPTION
(BETA)gcloudcommand line flags and filter expressions that expect date/time string valuessupport common input formats. These formats fall into two main categories:absolute date/times and relative durations.
Absolute date/time formats
Absolute date/time input formats minimally supportISO 8601 andRFC 822 date/times. Whenomitted the date/time value defaults are:
  • year, month, day - current value
  • hour, minute, second, fractional second - 0

The supported absolute date/time input formats are listed here.

ISO 8601 / RFC 3339 zulu:

2003-09-25T10:49:41.519Z2003-09-25T10:49:41Z

ISO 8601 numeric timezone offset:

2003-09-25T10:49:41.5-00002003-09-25T10:49:41.5-03:002003-09-25T10:49:41.5+0300

ISO with omitted parts:

2003-09-25T10:49:412003-09-25T10:492003-09-25T102003-09-25

RFC 822:

Thu,25Sep200310:49:41-0300

UNIX date command, explicit timezone:

ThuSep2510:36:28EDT2003200310:36:28EDT25SepThu

local timezone:

ThuSep2510:36:282003

omitted parts (date parts default to the current date, time parts default to 0):

ThuSep2510:36:28ThuSep10:36:28Thu10:36:28Thu10:3610:36

omitted parts with different order:

ThuSep252003Sep252003Sep2003Sep2003

ISO no separators:

20030925T104941.5-030020030925T104941-030020030925T10494120030925T104920030925T1020030925

no T separator:

20030925104941200309251049

other date orderings:

2003-09-252003-Sep-2525-Sep-2003Sep-25-200309-25-2003

other date separators:

2003.Sep.252003/09/252003Sep2520030925
Relative duration date/time formats
A relative duration specifies a date/time relative to the current time. Relativedurations are based onISO 8601 durations.They are case-insensitive and must be prefixed with +P or -P.

A fully qualified duration string contains year, month, day, hour, minute,second, and fractional second parts. Each part is a number followed by a singlecharacter suffix:

  • P - period (the duration designator)
  • Y - year
  • M - minute if after T or H, month otherwise
  • D - day
  • T - separates date parts from time parts
  • H - hour
  • M - minute if after T or H, month otherwise
  • S - second (for fractional seconds, use decimal value for seconds)

At least one part must be specified. Omitted parts default to 0.

-P1Y2M3DT4H5M6.7S+p1y2m3dT4h5m6.7s

A relative duration may be used in any context that expects a date/time string.

For example:

  • 1 month ago: -p1m
  • 30 minutes from now: +pt30m
  • 2 hours and 30 minutes ago: -p2h30m
Absolute duration formats
An absolute duration specifies a period of time. It has the same syntax as arelative duration except that there is no leading+ or-, and the leadingP is optional.

For example:

  • 1 month: 1m
  • 1 hour 30 minutes: 1h30m
  • 30 minutes: t30m
NOTES
This command is currently in beta and might change without notice. Thesevariants are also available:
gcloudtopicdatetimes
gcloudalphatopicdatetimes

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-07 UTC.