I need to set the default value to the datetime-localcurrent local time. Native JS seems to print in local time by default:
new Date($.now());
However, features like these toISOString()are displayed in UTC, and although I can locally pull out individual components, I donβt really want to play with the add-on, etc. So I am trying to use this with moment.js:
moment().local().format(); // "2016-11-12T22:34:05+11:00"
Cool! Now I just need to set the format to a small bit:
moment().local().format('YYYY-MM-DThh:mm'); // "2016-11-12T10:39"
Waaaaaaait. Now it is in UTC again, although I indicated local.
In this particular case, I could use string manipulations to just drop the end to pick a date, but of course I'm going to reach the point where I want to print local time in an arbitrary format. Did I miss something?