Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

printing of POSIXct should (could?) include tz info if it's there #2842

Closed
MichaelChirico opened this issue May 6, 2018 · 1 comment · Fixed by #3500
Closed

printing of POSIXct should (could?) include tz info if it's there #2842

MichaelChirico opened this issue May 6, 2018 · 1 comment · Fixed by #3500
Milestone

Comments

@MichaelChirico
Copy link
Member

@MichaelChirico MichaelChirico commented May 6, 2018

DT = data.table(
  t1 = as.POSIXct('2018-05-01 12:34:56', tz = 'UTC'),
  t2 = as.POSIXct('2018-05-01 12:34:56', tz = 'Asia/Singapore')
)
DT
#                     t1                  t2
# 1: 2018-05-01 12:34:56 2018-05-01 12:34:56
DT$t1
# [1] "2018-05-01 12:34:56 UTC"
DT$t2
# [1] "2018-05-01 12:34:56 +08"

The printed output makes t1 and t2 seem identical, but they're not.

The same problem applies to data.frames, to be fair:

setDF(copy(DT))[]
#                    t1                  t2
# 1 2018-05-01 12:34:56 2018-05-01 12:34:56

Probably timezone printing should be on by default due to the above, but at least there should be an option.

@jangorecki
Copy link
Member

@jangorecki jangorecki commented May 6, 2018

default format probably best something like +00:00, less dependent on timezone dictionaries in OSes

@mattdowle mattdowle removed this from the 1.12.0 milestone Jan 6, 2019
@mattdowle mattdowle added this to the 1.12.2 milestone Jan 6, 2019
@jangorecki jangorecki removed this from the 1.12.2 milestone Jan 24, 2019
@jangorecki jangorecki added this to the 1.12.4 milestone Jan 24, 2019
fparages pushed a commit to fparages/data.table that referenced this issue Apr 10, 2019
@fparages fparages mentioned this issue Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants