Skip to content

Instantly share code, notes, and snippets.

@ucpwang
Created January 24, 2018 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ucpwang/e3834b205500cd25fd207e8a9723b96f to your computer and use it in GitHub Desktop.
Save ucpwang/e3834b205500cd25fd207e8a9723b96f to your computer and use it in GitHub Desktop.
UTC기준 RFC822 포멧 시간 문자열 만들기 (java, javascript)

UTC기준 RFC822 포멧 시간. (ddd, DD MMM YYYY HH:mm:ss ZZ)

  1. javascript > moment
var gmtDateRFC822 = moment.utc().format('ddd, DD MMM YYYY HH:mm:ss ZZ');
console.log(gmtDateRFC822)
// Wed, 24 Jan 2018 10:01:13 +0000
  1. java > DateTimeFormat
String gmtDateRFC822 = DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss Z")
            .withZoneUTC()
            .withLocale(Locale.UK)
            .print(new DateTime());
System.out.println(gmtDateRFC822);
// Wed, 24 Jan 2018 10:04:27 +0000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment