asked on August 20, 2017
I have a Forms user that wants to convert the actual time a form was started to CST (not submitted) due to regulatory requirements- I am able to accomplish this in code using utc with an offset but this will not work when we move away from daylight savings time. Does anyone know how to account for daylight savings time when converting utc in jquery? I have attached my current code. Thank you in advance!
$(document).ready(function(){ d = new Date(); localTime = d.getTime(); localOffset = d.getTimezoneOffset() * 60000; utc = localTime + localOffset; offset = -5; cst = utc + (3600000*offset); nd = new Date(cst); newdate = (nd.toLocaleString()); $('#q315 Input').val(newdate + ' CST'); });
0
0