moto icon indicating copy to clipboard operation
moto copied to clipboard

Make Redshift creation time to be UTC

Open matanabudy opened this issue 3 years ago • 1 comments

Currently Redshift snapshot is initialized with datetime.now() instead of datetime.utcnow(). It should be UTC time for compatibility.

For reference see models.py. In cluster creation it is:

self.create_time = iso_8601_datetime_with_milliseconds(datetime.datetime.utcnow())

And in snapshot creation it is:

self.create_time = iso_8601_datetime_with_milliseconds(datetime.datetime.now())

matanabudy avatar Aug 03 '22 11:08 matanabudy

Thanks for raising this @matanabudy - marking it as a bug to fix this

bblommers avatar Aug 04 '22 15:08 bblommers

Hi, long time but it looks the bug hasn't been actually solved - there are still places (including the original one in the issue - class Snapshot - https://github.com/getmoto/moto/blob/b7624e10b1ec1e351c30b7f8dce76d4f33efcc69/moto/redshift/models.py#L537 Also happening in RDS in some places such as: https://github.com/getmoto/moto/blob/b7624e10b1ec1e351c30b7f8dce76d4f33efcc69/moto/rds/models.py#L553

matanabudy avatar May 28 '23 14:05 matanabudy

Hi @matanabudy - looks like I got RDS and Redshift confused in my first PR.

I've now raised a new PR to change all creation times in RDS and Redshift to be UTC - this should be fixed as of moto >= 4.1.11.dev23

bblommers avatar Jun 01 '23 10:06 bblommers