as.POSIXct 拒绝 +1300 时区 [英] as.POSIXct rejects +1300 timezone

查看:24
本文介绍了as.POSIXct 拒绝 +1300 时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 as.POSIXct 来解析带有时区的时间,如下所示:

I'm using as.POSIXct to parse times with timezones, like this:

as.POSIXct("2009-01-05 14:19 +1200", format="%Y-%m-%d %H:%M %z")

但是,如果字符串包含时区信息+1300,则函数返回NA:

However, if the string includes the timezone information +1300, the function returns NA:

> as.POSIXct("2009-01-05 14:19 +1300", format="%Y-%m-%d %H:%M %z")
[1] NA

显然 +1300 是一个有效的时区 (NZDT – 新西兰夏令时).如何说服 R 解析它?

Aparently +1300 is a valid timezone (NZDT – New Zealand Daylight Time). How to convince R to parse it?

推荐答案

这是一个 bug 在 3.0.2 版本中,它是 已修复 R-3.1.0 已修补 构建.

This was a bug in 3.0.2 release, which was fixed in R-3.1.0 Patched build.

这篇关于as.POSIXct 拒绝 +1300 时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆