I still don’t understand.
Users select a date time in front end (it is their local time zone). Let’s say, they pick 2018-09-29 and time 16:00
How can I convert this time to their time zone? So I can schedule job at their time zone time.
You need to know what the utc_offset is for their given timezone. For instance, if a user is from San Francisco, they would be in the Pacific Time Zone, which has an offset of -08:00 from UTC. Then, the correct DateTime would be:
You can then store all input times in UTC, schedule using UTC time and convert it to the corresponding time in their time zone using offset (for instance, to display in the UI.)
That is not sufficient. You need to know their time zone, because UTC offset at this moment in time does not tell you what their UTC offset would be at some other moment in time.
This is a classic example of the shittiness of web browsers and Javascript library design. There has been no API for this. There are ways to get at it in some browsers, using the internationalization API. Your best bet is probably to use the moment.js timezone functions. Alternatively you can do what a lot of web-based apps do: ask the user to select their time zone in preferences.