Yngvarr

Generation

generate functionThu, 22 Dec 2022

date to text

function dateToText(input) { var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; var date = input.toString(); var year = date.slice(0, 4); var month = date.slice(4, 6); var day = date.slice(6, 8); return months[month - 1] + " " + day + ", " + year; } dateToText(20180822)

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant