I have an ajax request that returns a date and time. my ajax output is 7/22/2017, 3:35:51 PM
, How can I get the time and have a condition between 9:00am to 5:00pm. Thank you in advance.
$.ajax({
async: false,
type: "POST",
url: apicall,
success: function (response) {
console.log(response);
var offsets = response.dstOffset * 1000 + response.rawOffset * 1000 // get DST and time zone offsets in milliseconds
var localdate = new Date(timestamp * 1000 + offsets) // Date object containing current time of Tokyo (timestamp + dstOffset + rawOffset
console.log(localdate.toLocaleString()) // Display current Tokyo date and time
}
});