[英]Convert date from yyyy-mm-dd to utc format
I have a date, "2015-06-08".我有一个日期,“2015-06-08”。 I want convert it to "08 June 2015"
我想将其转换为“2015 年 6 月 8 日”
String oldDateString = "2015-06-08";
SimpleDateFormat oldDateFormat = new SimpleDateFormat("yyyy-mm-dd", Locale.getDefault());
SimpleDateFormat newDateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.getDefault());
Date date = oldDateFormat.parse(oldDateString);
String result = newDateFormat.format(date);
but this does not work correctly.但这不能正常工作。 It returns "08 January 2015".
它返回“2015 年 1 月 8 日”。 What have I done wrong?
我做错了什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.