Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #35589
| 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 <tsdh@gnu.org> |
| 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> (permalink) |
| References | <87inu8gpqv.fsf@gnu.org> <XSD8BfGz2y0XFwl7@invalid.uk.co.demon.merlyn.invalid> |
| 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 |
Show key headers only | View raw
Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> 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.
> <http://web.archive.org/web/20150723023855/http://www.merlyn.demon.co.uk
> /weekinfo.htm> or later, <http://web.archive.org/web/20150711063435/http
> ://www.merlyn.demon.co.uk/weekcalc.htm> or later, and <http://web.archiv
> 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
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Parsing calendar weeks to LocalDates with DateTimeFormatter Tassilo Horn <tsdh@gnu.org> - 2016-09-07 08:58 +0200
Re: Parsing calendar weeks to LocalDates with DateTimeFormatter Tassilo Horn <tsdh@gnu.org> - 2016-09-07 10:11 +0200
Re: Parsing calendar weeks to LocalDates with DateTimeFormatter Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-09-09 22:46 +0100
Re: Parsing calendar weeks to LocalDates with DateTimeFormatter Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-09-11 16:43 +0100
Re: Parsing calendar weeks to LocalDates with DateTimeFormatter Lew <lewbloch@gmail.com> - 2016-09-13 17:50 -0700
Re: Parsing calendar weeks to LocalDates with DateTimeFormatter Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-09-17 19:34 +0100
Re: Parsing calendar weeks to LocalDates with DateTimeFormatter Tassilo Horn <tsdh@gnu.org> - 2016-09-12 09:18 +0200
Re: Parsing calendar weeks to LocalDates with DateTimeFormatter Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-09-13 23:39 +0100
csiph-web