zno2

"2016-10-06T12:09:18.303+0800"

Java 

    public static void main(String[] args) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
        String dstr = sdf.format(new Date());
        System.out.println(dstr);

        Date d = sdf.parse("2016-10-06T12:09:18.303+0800");
        System.out.println(d);

    }

输出结果:

2016-10-06T12:10:30.429+0800
Thu Oct 06 12:09:18 CST 2016

 

JavaScript

    var d = new Date("2016-10-06T12:00:36.798+0800");
    console.dir(d);

输出结果:

Thu Oct 06 2016 12:00:36 GMT+0800 (中国标准时间)

 

T 是什么

http://www.w3schools.com/js/js_date_formats.asp

The T in the date string, between the date and time, indicates UTC time.

T = UTC

UTC (Universal Time Coordinated)  is the same as GMT (Greenwich Mean Time).

国际协调时(格林威治标准时间)

英国伦敦格林尼治天文台旧址所在位置为零度经线,划分24时区,中国为东8(+8)

+12 是一天中最早的

 

posted on 2016-10-09 16:23  zno2  阅读(242)  评论(0编辑  收藏  举报

导航