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 exception play.exceptions.JavaExecutionException: Illegal pattern character 'Y'
.
I search for solution for this and found the year pattern must be change to lower-case:
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
and it works.
Can anyone can tell me the reason behind this why in Windows works but in Ubuntu didn't work if I use 'Y' instead of 'y'?
Note:
- Play-1.2.3
- JRE:
- Windows:
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) Client VM (build 22.1-b02, mixed mode, sharing)
- Ubuntu:
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)
- Windows 7
- Ubuntu 10.04
Update 24/05/2012
After I check again in my system, there is 3 JRE and my windows using JRE1.7 for default. But for Play I set running using JRE1.6.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…