File: date-today.Rd

package info (click to toggle)
r-cran-clock 0.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,856 kB
  • sloc: cpp: 19,564; sh: 17; makefile: 2
file content (46 lines) | stat: -rw-r--r-- 1,155 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/date.R, R/posixt.R
\name{date-today}
\alias{date-today}
\alias{date_today}
\alias{date_now}
\title{Current date and date-time}
\usage{
date_today(zone)

date_now(zone)
}
\arguments{
\item{zone}{\verb{[character(1)]}

A time zone to get the current time for.}
}
\value{
\itemize{
\item \code{date_today()} a single Date.
\item \code{date_now()} a single POSIXct.
}
}
\description{
\itemize{
\item \code{date_today()} returns the current date in the specified \code{zone} as a Date.
\item \code{date_now()} returns the current date-time in the specified \code{zone} as a
POSIXct.
}
}
\details{
clock assumes that Date is a \emph{naive} type, like naive-time. This means that
\code{date_today()} first looks up the current date-time in the specified \code{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("")

# Current date in a specified time zone
date_today("Europe/London")

# Current date-time in that same time zone
date_now("Europe/London")
}