I have this date that is saved in my database as UTC and looks 2019-04-25T08:47:14.813
when I console log it out.
I read to convert that to my local time I can just cast it as a Date
and the do toString()
and it would be my local time zone, but it doesn't seem to work with UK Daytime saving.
For example, if I take the string above and do this:
let d = new Date(item.lastChecked);
console.log(d.toString());
console.log(item.lastChecked);
The response I get is:
Thu Apr 25 2019 08:47:14 GMT+0100 (British Summer Time)
2019-04-25T08:47:14.813
I don't want it to save (British Summer Time). I want it to say 9:47
instead.
How can I do that?