0

So I was trying to get timezone info by id in lambda application. It is working fine on the local machine, but it throws an error when I publish on aws lambda.

TimeZoneInfo.FindSystemTimeZoneById(Common.NotifyTimeZone);

NotifyTimeZone value is "Pacific Standard Time"

The exception is "The time zone ID 'Pacific Standard Time' was not found on the local computer"

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Your local machine is windows machine? – Chetan Nov 11 '19 at 15:48
  • What versions of .Net are being used - local and AWS? – phuzi Nov 11 '19 at 15:49
  • 3
    https://stackoverflow.com/questions/41566395/timezoneinfo-in-net-core-when-hosting-on-unix-nginx – Chetan Nov 11 '19 at 15:50
  • https://devblogs.microsoft.com/dotnet/cross-platform-time-zones-with-net-core/ – Chetan Nov 11 '19 at 15:51
  • @phuzi I am using net core 2.1 –  Nov 11 '19 at 15:54
  • @phuzi I don't think so. Before posting here, I searched for all the possible solutions on google. The link you shared has a different issue. I am having an issue with amazon web services Lambda. –  Nov 11 '19 at 16:02
  • 1
    The AWS lambda runs on Linux. And Linux does not have timezones info available the same way it's available in windows machine. That's why you are getting error on lambda. Please read the links mentioned in the comments to understand it better. The links also have solution around it. – Chetan Nov 11 '19 at 16:02
  • @ChetanRanpariya Oh okay. –  Nov 11 '19 at 16:03
  • AWS Lambdas run on Amazon Linux. What about that is not relevant? https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html – phuzi Nov 11 '19 at 16:09

0 Answers0