I have a form that a user can input a datetime
<input class="form-control" name="aution_end_time" required type="datetime-local id="auction_end_time-input">
Now what I would like to do is convert this "local datetime object" to UTC time and store that value in a hidden input of the form.
<input type="hidden" class="form-control" name="auction_end_time_utc">
How would I go about this?
user enters a datetime in the form, then once they do that the hidden input gets updated with the same datetime but in UTC. I am unsure of how to determine the users local time zone and how to convert to UTC. Thanks!