5 ms·
yoda time seems not to be affected: * Y year of era (>=0) year 1996 * x weekyear year 1996 *
by fdsfsdaffdsa 12y ago
yoda time seems not to be affected:
* Y year of era (>=0) year 1996
* x weekyear year 1996
* y year year 1996
- ddlatham 12y agoIf you mean Joda time, then "xxxx" is also affected (which is correct behavior): public static void main(String[] args) { long now = System.currentTimeMillis(); System.out.println("YYYY: " + DateTimeFormat.forPattern("YYYY").print(now)); System.out.println("yyyy: " + DateTimeFormat.forPattern("yyyy").print(now)); System.out.println("xxxx: " + DateTimeFormat.forPattern("xxxx").print(now)); } prints YYYY: 2014 yyyy: 2014 xxxx: 2015
- Dylan16807 12y agoNobody will use xxxx by accident, so it's not 'affected' by any problem/confusion, it's just there doing what the developer intended.
- abrodersen 12y agoClearly, Yoda has 900 years of experience dealing with datetime bugs.
- smackfu 12y agoY and y are only different for BC dates in the Gregorian calendar, so using the incorrect one generally isn't going to cause problems.