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();
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.