当前日期和时间
例子
now()
#> [1] "2023-02-14 11:55:06 UTC"
now("GMT")
#> [1] "2023-02-14 11:55:06 GMT"
now("")
#> [1] "2023-02-14 11:55:06 UTC"
now() == now() # would be TRUE if computer processed both at the same instant
#> [1] FALSE
now() < now() # TRUE
#> [1] TRUE
now() > now() # FALSE
#> [1] FALSE
today()
#> [1] "2023-02-14"
today("GMT")
#> [1] "2023-02-14"
today() == today("GMT") # not always true
#> [1] TRUE
today() < as.Date("2999-01-01") # TRUE (so far)
#> [1] TRUE
相关用法
- R lubridate DateTimeUpdate 更改日期对象的组成部分
- R lubridate stamp 基于人性化模板设置日期和时间格式
- R lubridate interval 用于创建和操作 Interval 对象的实用程序
- R lubridate is.difftime x 是 difftime 对象吗?
- R lubridate as_date 将对象转换为日期或日期时间
- R lubridate date 获取/设置日期时间的日期部分
- R lubridate round_date 日期时间对象的舍入、取整和取整方法
- R lubridate make_difftime 创建一个 difftime 对象。
- R lubridate is.timespan x 是时间长度吗?
- R lubridate with_tz 获取不同时区的日期时间
- R lubridate mplus 在日期中添加和减去月份,但不超过新月份的最后一天
- R lubridate cyclic_encoding 日期时间的循环编码
- R lubridate as.interval 将对象更改为间隔
- R lubridate second 获取/设置日期时间的秒部分
- R lubridate quarter 获取日期时间的财政季度和学期
- R lubridate posix_utils 各种 POSIX 实用程序
- R lubridate date_decimal 将小数转换为日期
- R lubridate as.duration 将对象更改为持续时间
- R lubridate hour 获取/设置日期时间的小时部分
- R lubridate minute 获取/设置日期时间的分钟部分
- R lubridate month 获取/设置日期时间的月份部分
- R lubridate duration 创建一个持续时间对象。
- R lubridate leap_year 一年是闰年吗?
- R lubridate local_time 从日期时间向量获取当地时间。
- R lubridate make_datetime 从数字表示高效创建日期时间
注:本文由纯净天空筛选整理自Hadley Wickham等大神的英文原创作品 The current day and time。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。