How can I print a non UTC timestamp using datatable (DT package) in Rmarkdown?

Viewed 816

I have some timestamps stored in different time-zones that I would like to include in a datatable using DT package within a rmarkdown document.

I would like to display the timestamp in the stored time-zone but for some reason datatable converts it to UTC. The behaviour when I use print is what I want but the format is not nice.

How can I achieve the same behaviour with datatable and print?

Here a minimal working example of the rmarkdown file:

---
title: "MinorQ"
output: html_document
---

```{r setup}
library(DT)
df=data.frame(timestamp=as.POSIXct("2017-01-01 12:34:56",tz="CET"))
df$tzone=attr(df$timestamp,"tzone")
datatable(df)
print(df)
```
1 Answers
Related