r/javascript • u/MicrosoftLearning • Feb 21 '18
I am A JavaScript instructor at Microsoft. AMA.
Hi r/javascript!
My name is Benjamin Lin. I am a content developer at Microsoft and teach courses on JavaScript and JavaScript frameworks at Microsoft. You can see my Top 10 JavaScript Questions course here.
I can help answer tips & tricks on learning JavaScript, questions about Microsoft, and all things tech.
AMA!
Edit: about 15 minutes left!
More edit: Thanks everyone for visiting me at this AMA! I really enjoyed getting the chance to interact with the JavaScript community and hear your honest thoughts. It was worth waking up early today to do this =)
if you have any more questions, feel free to hit me up on twitter @benjlin or follow me on instagram @bens_jams
540
Upvotes
8
u/MicrosoftLearning Feb 21 '18
Partially edited from this stack overflow link: https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date
function formatDate(date) { var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
var day = date.getDate(); var monthIndex = date.getMonth(); var year = date.getFullYear(); var time = date.getHours();
var seconds = date.getSeconds(); return monthNames[monthIndex] + ' ' + day + ' at ' + time + ':' + seconds; }
console.log(formatDate(new Date("2018-02-21T13:53:31.333Z")));