Path: csiph.com!feeder.erje.net!1.us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!cache.uni-koblenz.de!not-for-mail From: Tassilo Horn Newsgroups: comp.lang.java.programmer Subject: Re: Parsing calendar weeks to LocalDates with DateTimeFormatter Date: Mon, 12 Sep 2016 09:18:51 +0200 Organization: University Koblenz-Landau Campus Koblenz Lines: 44 Message-ID: <8760q1fuw4.fsf@gnu.org> References: <87inu8gpqv.fsf@gnu.org> NNTP-Posting-Host: j289989.servers.jiffybox.net Mime-Version: 1.0 Content-Type: text/plain X-Trace: cache.uni-koblenz.de 1473664731 13232 134.119.24.195 (12 Sep 2016 07:18:51 GMT) X-Complaints-To: news@cache.uni-koblenz.de NNTP-Posting-Date: Mon, 12 Sep 2016 07:18:51 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:fy1HGVR5vmR0a2MQCZBZ101RKK8= Xref: csiph.com comp.lang.java.programmer:35589 Dr J R Stockton writes: Hi, >>I have a >> >> DateTimeFormatter FORMATTER_KW = DateTimeFormatter.ofPattern("ww.YYYY"); >> >>for formatting LocalDates as calendar weeks. > > > Firstly, you need to say, clearly, what your definition of Week > Numbering is. > > You seem to be at U.Koblenz, Not anymore but... > so you should be using ISO 8601 weeks, in which all weeks are Mon=1 to > Sun=7 and Week 01 contains January 4th (i.e. is the first week which > is all or mostly in the Gregorian Year), so the last week of the year > is numbered 52 or 53; there is never a Week 00 or a Week 54. ...that's the week numbering definition we are using, yes. > ISO Week Numbering is used throughout the sensible part of the > Gregorian world, but not much along the Mexico-Canada borderland. As far as I can tell, we don't have a customer in the Mexico-Canada borderland yet. > /weekinfo.htm> or later, ://www.merlyn.demon.co.uk/weekcalc.htm> or later, and e.org/web/20150703002408/http://www.merlyn.demon.co.uk/js-date7.htm> or > later, might help readers; but their code is not Java. No problem in not being Java, and it's definitely nice how to do these calculations "by hand". Yet my question was if there was some standard way to come from a calendar week (ISO 8601) to a LocalDate other than the snippet I've posted. Bye, Tassilo