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
Closed
Labels
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.

@MichaelChirico MichaelChirico mentioned this issue May 6, 2018
10 of 14 tasks complete
@jangorecki jangorecki added this to the 1.11.4 milestone May 6, 2018
@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 modified the milestones: 1.12.0, 1.12.2 Jan 6, 2019
@jangorecki jangorecki modified the milestones: 1.12.2, 1.12.4 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
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.