Shabbir, Date are stored as UTC and thus you need to give your dates a time component and adjust to timezone offset.Here is some code I use to set a date field attribute: var bDate1:Date = new Date(DTPicker1.selectedDate.getFullYear(),DTPicker1.selectedDate.getMonth(),DTPicker1.selectedDate.getDate(),14,0,0,0); offsetMilliseconds = bDate1.getTimezoneOffset() * 60 * 1000; bDate1.setTime(bDate1.getTime() - offsetMilliseconds); attribs.Begin_Date_Occ = bDate1.getTime();
var bDate1:Date = new Date(DTPicker1.selectedDate.getFullYear(),DTPicker1.selectedDate.getMonth(),DTPicker1.selectedDate.getDate(),14,0,0,0); offsetMilliseconds = bDate1.getTimezoneOffset() * 60 * 1000; bDate1.setTime(bDate1.getTime() - offsetMilliseconds); attribs.Begin_Date_Occ = bDate1.getTime();
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.