cloudyr / aws.s3

Amazon Simple Storage Service (S3) API Client
https://cloud.r-project.org/package=aws.s3
381 stars 147 forks source link

POSIXct timestamps from head_object() #386

Open wlandau opened 3 years ago

wlandau commented 3 years ago

I noticed that timestamps from attr(head_object(), "last-modified") are plain character strings (e.g. "Sun, 28 Mar 2021 04:09:09 GMT") while the analogous timestamps from get_bucket_df() are already parsed into POSIXct objects. Is there a built-in way in aws.s3 to get POSIXct timestamps from head_object(). I can manually convert the current head_object() timestamps to POSIXct using as.POSIXct(my_timestamp, format = "%a, %d %b %Y %H:%M:%S", tz = "GMT"), but I am concerned that I am overfitting the format specification and it may break when AWS or aws.s3 changes.