I'm using Nodejs and serverless with AWS Lambda functions to create a user profile and detect their timezone automatically. The thing is that the two methods I have tried using work fine locally although not really accurately.
import { tz } from 'moment-timezone';
let timezone = Intl && Intl.DateTimeFormat().resolvedOptions().timeZone; // This might be unsupported
if (!timezone || timezone.toLowerCase() === 'utc') {
timezone = tz.guess();
}
However, when the application is deployed on the Amazon cloud (it is set correctly by professionals and I don't have direct access to it), the timezone I receive from my site is UTC or Africa/Abidjan (+0000) although my timezone is Asia/Jerusalem (+0300). The region of the serverless is set to us-east-1.
Can I know what might be going wrong so I can fix it? Or have some explanation of what is going on so as to have a clear understanding of how things work and thus use the right method?
Thank you