Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

date to-timezone for date

Convert a date to a given time zone.

Signature

> date to-timezone {flags} (time zone)

Parameters

  • time zone: Time zone description.

Input/output types:

inputoutput
datetimedatetime
stringdatetime

Examples

Get the current date in UTC+05:00.

> date now | date to-timezone '+0500'

Get the current date in the local time zone.

> date now | date to-timezone local

Get the current date in Hawaii.

> date now | date to-timezone US/Hawaii

Get a date in a different time zone, from a string.

> "2020-10-10 10:00:00 +02:00" | date to-timezone "+0500"
Sat, 10 Oct 2020 13:00:00 +0500 (4 years ago)

Get a date in a different time zone, from a datetime.

> "2020-10-10 10:00:00 +02:00" | into datetime | date to-timezone "+0500"
Sat, 10 Oct 2020 13:00:00 +0500 (4 years ago)

Notes

Use 'date list-timezone' to list all supported time zones.