Usage
date_today(zone)
date_now(zone)
Arguments
- zone
[character(1)]
A time zone to get the current time for.
Details
clock assumes that Date is a naive type, like naive-time. This means that
date_today()
first looks up the current date-time in the specified zone
,
then converts that to a Date, retaining the printed time while dropping any
information about that time zone.
Examples
# Current date in the local time zone
date_today("")
#> [1] "2024-07-19"
# Current date in a specified time zone
date_today("Europe/London")
#> [1] "2024-07-19"
# Current date-time in that same time zone
date_now("Europe/London")
#> [1] "2024-07-19 12:56:01 BST"