Skip to content

Calculating timezone offset in YAML date field #1870

@jjallaire

Description

@jjallaire

Discussed in #1802

Originally posted by dtremblay-sher August 10, 2022
I would like my document's date to be effectively the equivalent of quarto's new "now" keyword. The problem is that the remote system on which I use quarto has its system time set as UTC +0, but I am in a different timezone.

In rmarkdown, you can do something like:
date: "`r format(Sys.time(), '%Y-%m-%d %H:%M', tz='America/New_York')`"
which would convert the time appropriately.

I see options in date-format to show the system's timezone, but none that would perform timezone conversion.

I found this discussion in my search (#452) but it appears that OPs question was answered with the addition of the "now" keyword.

Any ideas? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions