Created
January 22, 2016 14:47
-
-
Save themeteorchef/1cecdfd03c54a7bcfa6a to your computer and use it in GitHub Desktop.
RFC-822 formatting for Moment.js
This file contains hidden or 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
// RFC-822 formatting string for Moment.js. | |
let timestamp = 'ddd, DD MMM YYYY hh:mm:ss'; | |
// Note, the "z" character responsible for setting the three-character timezone for a date in Moment.js is now deprecated. | |
// An easy workaround for this is to generate your date/time using the string above, appending the timezone manually. | |
// | |
// e.g. return `${ timestamp } CST`; | |
// | |
// Here, "CST" would need to be calculated on your own and would likely be a variable unless timezone is fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think it has to be
'ddd, DD MMM YYYY HH:mm:ss'
(with large H)