Time zones and JavaScript
Hello,
I need to calculate the day number in the year (‘quantième’ in French) from a date entered by the user in a Date field.
Problem: my client is in the French West Indies in the UTC-4 time zone.
At my location (in France, UTC+2), it works correctly, but at my client's location, there is always a one-day less in the result obtained by my script.
Does Acrobat JavaScript take into account the time zone set on the user's computer?
Or have I made a mistake elsewhere?
Here is the script used:
var maDate2 = this.getField("P1.date").value; // Date field yyyy-mm-dd
var MyDate = new Date(maDate2);
var PremierJour = Date.UTC(MyDate.getFullYear(), 0, 0); // premier jour = first day
var Aujourdhui = Date.UTC(MyDate.getFullYear(), MyDate.getMonth(), MyDate.getDate()); // aujourd'hui = today
var result = Math.floor((Aujourdhui - PremierJour) / (1000 * 60 * 60 * 24));
Thank you

