To make sure we're on the same page, I just want to reiterate that the unix timestamp is just the number of seconds since the "Unix Epoch" (January 1, 1970). Therefore, simple math will work with unix timestamps.
There are two ways to do this; judging by your post, you are embarrassed by what you would like to use.
The first method would be the easiest (and most logical) way, namely to store their offset (if you already have it, that is) and multiply by 3600 (1 hour in seconds), and then add that the value of the current time stamp is unix to get the final work time.
Another way to do this is to use the DateTime and DateTimeZone classes. How these two classes work, as shown here , is that you create two DateTimeZone objects, one with your time zone and one with them; create two DateTime objects with the first parameters "now" , and the second with a link to the DateTimeZone objects above (respectively); and then call the getOffset method of your time zone object, passing its time zone object as the first parameter, eventually getting the offset in seconds that you can add to the current unix timestamp to get the time during which their work should be done.
The second way seems a lot more complicated for such an easy task, if I say so, so the first solution may be better suited to your needs. However, if you want to have a more complete method, then using DateTime and DateTimeZone will definitely be an option.
A quick note about strtotime: Strtotime is the exact opposite of the date () command and will not be more useful than a βtoolβ to achieve what you are looking for. It alone will not convert or find biases for you; it just converts the formatted date and time to a unix timestamp.
source share