1

Given the aws-region like us-east-2, is there a way get current time of that region ?

Trying to write a job which triggers few actions if time is in between 12-1am on server. Current I have only AWS region where that server is running. Note that I cannot have this job running inside server, instead it needs to be called from separate service.

  • Hi. You've framed your question as an [XY Problem](https://meta.stackexchange.com/a/66378/201534) - That is, you're wanting to know how to schedule an AWS job based on a local time zone (the "X"), but instead you've decided to ask how to get the time zone of a region (the "Y"). I've closed the question as a duplicate of the X problem. There are two valid answers on that post. Thanks. – Matt Johnson-Pint Apr 18 '22 at 17:02
  • Also note that even if trying to get the time zone of the server were a valid approach (it's not), that would be problematic for an AWS region because a region is a clustering of multiple data centers. There is no guarantee that every data center in the region is physically located in the same local time zone. It's entirely possible that a region could span multiple time zones. – Matt Johnson-Pint Apr 18 '22 at 17:04

1 Answers1

0

AWS uses UTC for all regions. And I hope, they will never change that.

If you want to trigger a service for your specific timezone, create within that specific region the trigger (e.g. EventBridge) and adjust the time. So you can define in us-east-2 another time to trigger that event than e.g. in eu-central-1.

Daniel Seichter
  • 809
  • 1
  • 8
  • 14
  • 1
    But constraint is that, this service runs in single place/region. It needs to trigger API/action on servers running in different regions based on their local time. Hence kind of looking for api/lib which gives mapping between AWS region and timezone/time. – Karthik Hebbar Apr 15 '22 at 04:33
  • @KarthikHebbar - there aren't that many regions, so it should be a matter of a few minutes to create your own lookup table. – Parsifal Apr 15 '22 at 12:06