Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Easiest/shortest way to get day of week (e.g. MON) from "dd.mm.yyyy" string? Date: Mon, 21 Nov 2011 14:12:46 -0800 (PST) Organization: http://groups.google.com Lines: 18 Message-ID: <31270747.678.1321913566925.JavaMail.geo-discussion-forums@prnv30> References: <4eca833c$0$6571$9b4e6d93@newsspool3.arcor-online.net> <4eca8d1a$0$2507$ba4acef3@reader.news.orange.fr> <4eca8e1c$0$2507$ba4acef3@reader.news.orange.fr> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 2620:0:1000:2404:224:d7ff:fe69:5838 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1321913567 8207 127.0.0.1 (21 Nov 2011 22:12:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 21 Nov 2011 22:12:47 +0000 (UTC) In-Reply-To: <4eca8e1c$0$2507$ba4acef3@reader.news.orange.fr> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2620:0:1000:2404:224:d7ff:fe69:5838; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10167 jlp wrote: > jlp a =E9crit : >> Sven Fischer a =E9crit : >>> Assume I have a date as a string with the pattern "dd.mm.yyyy". >>> >>> What is the easiest/shortest way to get the day of week (e.g. "MON" >>> for Monday) >>> from this date? >>> >> create a Calendar object with the date and Calendar.get( DAY_OF_WEEK) >> return 0 for SUNDAY, 1 for MONDAY ... >> > Sorry SUNDAY is 1, MONDAY 2 .... The numeric value is immaterial. --=20 Lew