I suspect that WEEK_OF_YEAR and YEAR do not generally behave the way you want. See this bug for more details:
http://bugs.sun.com/view_bug.do?bug_id=4267450 As for why this works for you locally and not when deployed to App Engine, I don't have a satisfactory answer. Have you verified that the timezones are the same (by adding "zzz" to your format string) ? On Mon, Dec 28, 2009 at 5:54 AM, Raphael André Bauer < [email protected]> wrote: > Hi, > > > I am currently using this code to calculate the week of the year: > > > ===snip > Calendar calendar = Calendar.getInstance(); > calendar.setTimeInMillis(millisecs); > DateFormat formatter = new SimpleDateFormat("yyyyww"); > > String timeStamp = formatter.format(calendar.getTime()); > ===snap > > Using the timestamp of now (1262000152901L) my local machine tells me: > "200953" what is correct. > > However, if I execute the very same code on the App Engine I get week > "200901" (!) what is strange, because the year is correct, but the > week is not... > > > Any ideas? > > Thanks a lot! > > > > Raphael > > -- > > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine-java%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
