Date: Mon, 30 Jun 2014 12:06:12 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 191512] New: /bin/date -j -v-sun returns a Saturday instead of Sunday Message-ID: <bug-191512-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D191512 Bug ID: 191512 Summary: /bin/date -j -v-sun returns a Saturday instead of Sunday Product: Base System Version: 9.3-RELEASE Hardware: i386 OS: Any Status: Needs Triage Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: chocolate.camera@gmail.com ## Summary For some specific dates (and maybe time zones) using `date` to get the time= and date of the previous Sunday returns a Saturday instead. ## Steps to reproduce I tried this on Mac OS X 10.9.3, as I do not have a FreeBSD system. I am su= re all steps can be reproduced with FreeBSD, I just cannot instruct you how. 1. In System Preferences > Date & Time, deactivate the setting to set ti= me and date automatically from a remote server. 2. Set you timezone to US/Pacific (Los Angeles, CA; I have not tried with other timezones) and your date and time to **Friday, 2014 March 14, 23:30**. 3. In Terminal, run: date -j -v-sun and take note of the output. 4. Set your time to 1 hour later, i.e. **Saturday, 2014 March 15, 00:30*= *, and run the same command again, taking note of the output. 5. Again, set again your date and time to 1 hour later, i.e. **Saturday, 2014 March 15, 01:30**, and run the same command again, taking note of the output. ## Expected result The date returned should be the same on 3, 4 & 5, only the hour changing (it being the same as the one you set it to, within seconds). I.e.: 3: Sun Mar 9 23:30:00 PST 2014=20=20 4: Sun Mar 9 00:30:00 PST 2014=20=20 5: Sun Mar 9 01:30:00 PST 2014 ## Actual results Only for the moment in the middle, **Saturday, 2014 March 15, from 00:00:00= to 00:59:59**, the command returns the previous Saturday instead of the previo= us Sunday: 3: Sun Mar 9 00:30:00 PST 2014=20=20 4: Sat Mar 8 23:30:00 PST 2014=20=20 5: Sun Mar 9 00:30:00 PST 2014 #Note Probably it has to do with the change to/from Daylight Saving Time, which f= or US/Pacific is **Sunday, March 9, 02:00** and **Sunday, November 2, 2:00**. The command is not requesting the date of today minus 1 week, though, but t= he date of the previous Sunday, so it should return a Sunday irrespective of a= ny change from/to Daylight Saving Time. Don=E2=80=99t trust the "Version" field in this bug report as I do not know= what FreeBSD=E2=80=99s version of `date` Mac OS X 10.9.3 uses. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-191512-8>