Jump to content

Weird question, but still... Is there any method, api, anything to detect gmail client timezone setting?


t00r777
 Share

Recommended Posts

The answer is maybe. If you parse all the 'received from' headers you can usually (but not always) figure it out. There is a time stamp at the end of each that looks similar to this:

Sat, 20 Mar 2021 06:45:11 -0700

Most of the headers will have +0000 which are useless but if you find one like above, you have the UTC offset (-0700). In this case it is either MST or PDT. How you handle day light saving time is problematic.

Edited by gw1500se
Link to comment
Share on other sites

Guys, thank you for your answers. I forgot to include that i should send email as php and the problem is that gmail should correctly display when it was received to include that time for hour calculation and display into email content. I have a user selected timezone in the backend, but people are amazing and wonder why the thing will start after email receival :D

The problem is basically: Your session will start at 6:00 AM, but email is displayed as received at 7:00 AM.

 

Link to comment
Share on other sites

When it comes to the body content of your email, you just need to make it clear what timezone your referring too.  There's no way to automatically change it to whatever the receivers timezone is.

So instead of saying 'Your session starts at 6:00 AM'

You should say: 'Your session starts at 6:00 AM Eastern Standard Time'

Then the end-user can convert the time if necessary on their own.  If you can get them to tell you their timezone on your site before sending the email then you can send the message using that timezone, but still include the timezone indicator in case they selected the wrong timezone or have changed time zones since the message was sent.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.