How to get week of year figure in GWT
问题 Is there a simple way how to get week of year information from a Date object or from millis time in GWT on the client side? 回答1: Something like this: Date date = new Date(); Date yearStart = new Date(date.getYear(), 0, 0); int week = (int) (date.getTime() - yearStart.getTime())/(7 * 24 * 60 * 60 * 1000); Note that this will give you a week in a Date object, which has no time zone information. When you use it, you may have to adjust it using the time zone information. 回答2: How to do it with