Illegal pattern character 'Y' on Ubuntu

前端 未结 2 590
挽巷
挽巷 2020-12-18 22:30

I use this pattern SimpleDateFormat format = new SimpleDateFormat(\"YYYY-MM-dd HH:mm:ss\"); in windows and it works, but when try on Ubuntu 10.04 it show an exc

2条回答
  •  青春惊慌失措
    2020-12-18 22:58

    I search for SimpleDateFormat and got the doc from oracle.

    Works in my windows because I set the default JRE to 1.7 but still running using JRE1.6 for the Play Framework.

    enter image description here

    Works on Windows because of this, JRE1.7 has added 'Y' pattern for Week year and in JRE1.6 there is no pattern for this.

提交回复
热议问题