Skip to content

Commit 2f3a7ff

Browse files
committed
Crosslink, and mention that these are not drop-in replacements
1 parent 88562d7 commit 2f3a7ff

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

R/date.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,18 @@ as.Date.clock_zoned_time <- function(x, ...) {
135135
#' There are methods for converting date-times (POSIXct), calendars,
136136
#' time points, and zoned-times to dates.
137137
#'
138+
#' For converting to a date-time, see [as_date_time()].
139+
#'
138140
#' @details
139141
#' Note that clock always assumes that R's Date class is naive, so converting
140142
#' a POSIXct to a Date will always retain the printed year, month, and day
141143
#' value.
142144
#'
145+
#' This is not a drop-in replacement for `as.Date()`, as it only converts a
146+
#' limited set of types to Date. For parsing characters as dates, see
147+
#' [date_parse()]. For converting numerics to dates, see [vctrs::new_date()] or
148+
#' continue to use `as.Date()`.
149+
#'
143150
#' @param x `[vector]`
144151
#'
145152
#' A vector.

R/posixt.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ as.POSIXlt.clock_zoned_time <- function(x, ...) {
167167
#' There are methods for converting dates (Date), calendars, time points, and
168168
#' zoned-times to date-times.
169169
#'
170+
#' For converting to a date, see [as_date()].
171+
#'
170172
#' @details
171173
#' Note that clock always assumes that R's Date class is naive, so converting
172174
#' a Date to a POSIXct will always attempt to retain the printed year, month,
@@ -175,6 +177,11 @@ as.POSIXlt.clock_zoned_time <- function(x, ...) {
175177
#' that issue ever arises, an error will be thrown, which can be resolved by
176178
#' explicitly supplying `nonexistent` or `ambiguous`.
177179
#'
180+
#' This is not a drop-in replacement for `as.POSIXct()`, as it only converts a
181+
#' limited set of types to POSIXct. For parsing characters as date-times, see
182+
#' [date_time_parse()]. For converting numerics to date-times, see
183+
#' [vctrs::new_datetime()] or continue to use `as.POSIXct()`.
184+
#'
178185
#' @inheritParams as-zoned-time-naive-time
179186
#'
180187
#' @param x `[vector]`

man/as_date.Rd

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/as_date_time.Rd

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)