I follow this api document, this api need a Date header, they said they only support GMT date format, so I tried all bellow, but no one success.
@Test
public void testFormat(){
Date a = new Date("Tue, 08 Dec 2015 06:13:40 GMT");
System.out.println(a);
Date b = new Date("Thu, 17 Mar 2012 18:49:58 GMT");
System.out.println(b);
System.out.println(b.toGMTString()); // 17 Mar 2012 18:49:58 GMT
System.out.println(b.toLocaleString());// 2012-3-18 2:49:58
System.out.println(DateFormatUtils.ISO_8601_EXTENDED_DATETIME_TIME_ZONE_FORMAT.format(b));//2012-03-18T02:49:58+08:00
}
So, what's the format like this Tue, 08 Dec 2015 06:13:40 GMT
, how can I get this format in Java ?
EDIT
Output
Tue Dec 08 14:13:40 CST 2015
Sun Mar 18 02:49:58 CST 2012
17 Mar 2012 18:49:58 GMT
2012-3-18 2:49:58
2012-03-18T02:49:58+08:00
I'm not just asking the pattern, I was wondering is there any standard or name for this format ?