如何将前端传递的日期String date = orderInfoVO.getBusinessDate().toString();转变为yyMMdd格式的日期
时间: 2023-03-29 09:01:29 浏览: 72
你可以使用SimpleDateFormat类来将日期转换为yyMMdd格式。具体代码如下:
String date = orderInfoVO.getBusinessDate().toString();
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
String formattedDate = sdf.format(new Date(date));
System.out.println(formattedDate);
这将打印出格式化后的日期。
相关问题
如何用joda_time将前端传递的日期String date = orderInfoVO.getBusinessDate().toString();转变为yyMMdd格式的日期
你可以使用以下代码将日期转换为yyMMdd格式:
DateTimeFormatter formatter = DateTimeFormat.forPattern("yyMMdd");
DateTime dateTime = formatter.parseDateTime(date);
String formattedDate = dateTime.toString(formatter);
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231045021.png)
![-](https://img-home.csdnimg.cn/images/20241231045021.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://img-home.csdnimg.cn/images/20250102104920.png)
![](https://img-home.csdnimg.cn/images/20250102104920.png)
![](https://img-home.csdnimg.cn/images/20250102104920.png)
![application/msword](https://img-home.csdnimg.cn/images/20210720083327.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![application/msword](https://img-home.csdnimg.cn/images/20210720083327.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)