in my database one column has utcdatetime
value and i want show that date time in the timezone of the country.
this is my database value: 2020-02-25 11:12:28 PM and i want output a value for example us system: 2020-02-25 1:12:28 PM approximately because India is 10 hours and 30 minutes ahead of Washington, DC, USA
i tried with the code below:
function GridCreated(sender, args) {
var masterTable = $find("<%= dgAdminErrorLog.ClientID %>").get_masterTableView();
var items = masterTable.get_dataItems();
for (var i = 0; i < items.length; i++) {
var date = masterTable.getCellByColumnUniqueName(items[i], "ErrorDateTimeUtc").innerHTML;
// conver the date and set it back to the cell.
var d = new Date();
var systimezone = d.getTimezone();
var indiaTime = date.toLocaleString("en-US", { timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone});
masterTable.getCellByColumnUniqueName(items[i], "ErrorDateTimeUtc").innerHTML = indiaTime.toLocaleString();
}
}