0
我的日期格式爲yyyyMMddHHmm,從此dateformat我需要提取年,月,日,並將1259添加爲HHmm以創建一個新日期, 我正在使用joda日期時間。將零填充爲單個數字以分格式製作
String date = (Integer.toString(orderDate.getYear()) + Integer.toString(orderDate.getMonthOfYear()) + Integer.toString(orderDate.getDayOfMonth()) + "1259");
orderDate = DateTimeFormat.forPattern(DATE_FORMAT).withZone(DateTimeZone.forTimeZone(TimeZone.getTimeZone(date1TimeZone))).parseDateTime(String.valueOf(date));
但是,如果在orderDate
恰好是201611051212 我得到的結果是20161151259即一個月的值是5,我想爲05.是否有使時鐘輸入任何格式說明?