aws / aws/aws-cli

Wrong local file timestamp when using Europe/Dublin host timezone

Open
#6,595 9 comments 0 reactions 1 assignee Claimed by @kdaily View on GitHub
bug community contribution-ready p2 s3
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

Confirm by changing [ ] to [x] below to ensure that it's a bug:
- [x] I've gone though the [User Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) and the [API reference](https://docs.aws.amazon.com/cli/latest/reference/)
- [x] I've searched for [previous similar issues](https://github.com/aws/aws-cli/issues) and didn't find any solution

**Describe the bug**
Files copied from S3 to local (either with cp or sync) have wrong local timestamp (1 extra hour) in system with Europe/Dublin timezone set. Issue presents itself only when daylight saving time is not observed.

**Platform/OS/Hardware/Device**
aws-cli/1.18.114 Python/2.7.12 Linux/4.15.0-142-generic botocore/1.17.37/ Ubuntu 16.04
aws-cli/1.21.9 Python/3.8.10 Linux/5.4.72-microsoft-standard-WSL2 botocore/1.22.9 WSL2 Ubuntu 20.04

**To Reproduce (observed behavior)**
Set local timezone to Europe/Dublin and copy or sync file(s) from S3 to local.

**Expected behavior**
Timestamp of copied files should be the same as stored objects on S3, because Dublin timezone currently uses GMT, which has no offset compared to UTC.

**Logs/output**
When using sync, relevant file contents from S3:
`my_file2021-12-02T17:42:01.000Z`

Sync command trying to sync the file again, due to different timestamp detected:
`2021-12-03 13:24:01,986 - MainThread - awscli.customizations.s3.syncstrategy.base - DEBUG - syncing: my_bucket/my_file -> /home/aaversa/Documents/test_s3_sync/my_file, size: 3847 -> 3847, modified time: 2021-12-02 18:42:01+01:00 -> 2021-12-02 19:42:01+01:00`

Created local file has timestamp 18:42:01 instead of expected 17:42:01.

**Additional context**
When using Europe/London timezone the issue doesn't appear.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.