Why tibble is showing local time after reading feather file

112 views Asked by At

I have a pandas dataframe with timestamps, like that:

df = pd.DataFrame({'a': [pd.Timestamp('2020-01-01 00:00:00')]})

I write it to a feather file with df.to_feather('a.feather'), and read it back in R with df <- arrow::read_feather('a.feather').

When I display it, I see

A tibble: 1 × 1 a
<dttm>
2020-01-01 01:00:00

Where did the 01:00:00 come from? How can I get rid of it?

1

There are 1 answers

0
psarka On BEST ANSWER

ok, it seems that R or arrow is paying attention to some kind of global time zone variable. So the above behaviour can be fixed by adding

Sys.setenv(TZ='GMT')

in the beggining.

Inspired by this: https://arrow.apache.org/docs/python/timestamps.html