InterviewSolution
| 1. |
Why Are My Dates Formatted Wrong? Why Do I Get The False Year Value? |
|
Answer» When using own formats in your code you could come to a situation where you get for EXAMPLE 29.1 2.2009, but you expected to get 29.1 2.2008. There is one year difference: 2009 instead of 2008. You should USE the lower cased year CONSTANT. See this example: $date- >toString(dd.MM.yy);NOTE the lower cased “y” which makes the difference and outputs the REAL year. When using own formats in your code you could come to a situation where you get for example 29.1 2.2009, but you expected to get 29.1 2.2008. There is one year difference: 2009 instead of 2008. You should use the lower cased year constant. See this example: Note the lower cased “y” which makes the difference and outputs the real year. |
|