Last active
December 27, 2016 20:56
-
-
Save tomhodgins/6f6cdbd1a7a2e8703c4ccc03c25dae21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var date = new Date() | |
var j = date.getDate() | |
var suf = ['th', 'st', 'nd', 'rd'] | |
var v = j | |
var S = (suf[(v-20) % 10] || suf[v] || suf[0]) | |
var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] | |
var F = months[date.getMonth()] | |
var Y = date.getFullYear() | |
var formatted_date = (F + ' ' + j+S + ', ' + Y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date('F jS, Y'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment