Site icon Hip-Hop Website Design and Development

How to detect and handle the time difference between server and user in WordPress?

I have to make a custom plugin for a WordPress website. In this plugin, I have to create a meta box for a post where I have a time and date field that decides that when the post will be expired and will be moved in the trash. but the problem is that website has 2 admins situated in two different time zones. One admin is in GMT+2 and one admin is in GMT+4 and the webserver is running according to the GMT standard time.

Now the problem I am facing is that if admin 1 is set to post to expire at 6 PM then the post gets expire at 8 PM instead of 6 PM. On the other hand, 2nd admin sees the setting as expiring at 6 PM while he should see it as expiring at 8 PM.

How can I detect time differences before submitting them to the database? On other hand, I want the database time to be converted into local time to show in the value tag in input.

Can anyone help in this way, please?