Java 时间格式转换为:“2014-09-26T11:21:00+8:00”
import java.text.SimpleDateFormat; import java.util.Date; public class Test { public static void main(String[] args) { SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss+8:00"); Date date=new Date(); String dateString=simpleDateFormat2.format(date); System.out.println(dateString); } }
时间: 2024-10-24 11:18:09