java - nginx日期转换
nginx 日志的日期格式:27/Feb/2017:12:44:03 +0800
1 2 3 | <code class = "java" > SimpleDateFormat sourceFormat = new SimpleDateFormat( "dd/MMM/yyyy:hh:mm:ss Z" , Locale.ENGLISH);
SimpleDateFormat transferFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
transferFormat.format(sourceFormat.parse(time));</code>
|
用这种方式转换过来的是:2017-02-27 00:44:03
相差12小时怎么办?