quarto-dev / quarto-dev/quarto-cli

Calculating timezone offset in YAML date field

Open
#1,870 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/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 (https://github.com/quarto-dev/quarto-cli/discussions/452) but it appears that OPs question was answered with the addition of the "now" keyword.

Any ideas? Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading discussions 1802 and 452, then inspect the existing handling of Quarto's "now" keyword and date-format options. Done means documenting or implementing a way for a YAML date to convert the current time to a requested timezone, with the behavior verified against the reported UTC-versus-America/New_York use case.

Written by the indexing model from the issue text.

Assessment

Domain
localization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.