NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Strange problem with date(1) using the -d option calculating the wrong day of the week



Having an odd problem on a new 6.1.4 machine with the date(1) command using
the "-d" parameter. It is resolving a +"%a" to the wrong day of the week on
one server but not the older 5.1.2 machine.

==============================================
NetBSD/amd64 - 5.1.2 - Old server
==============================================

% uname -a
NetBSD ncti106.ncti.com 5.1.2 NetBSD 5.1.2 (GENERIC) #0: Thu Feb  2 12:12:28
UTC
 2012
builds%b7.netbsd.org@localhost:/home/builds/ab/netbsd-5-1-2-RELEASE/amd64/201202021
012Z-obj/home/builds/ab/netbsd-5-1-2-RELEASE/src/sys/arch/amd64/compile/GENE
RIC
amd64

% ls -l /etc/localtime
lrwxr-xr-x  1 root  wheel  34 Nov  6  2010 /etc/localtime ->
/usr/share/zoneinfo/Canada/Eastern

% date
Wed Jun 25 15:48:02 EDT 2014

% date -d "07/01/2014" +"%a"

Tue <- Calculates the DOW as a Tuesday - ***CORRECT***

==============================================
NetBSD/amd64 - 6.1.4 - New install
==============================================
# uname -a
NetBSD ncti103.ncti.com 6.1.4 NetBSD 6.1.4 (GENERIC) amd64

# ls -l /etc/localtime
lrwxr-xr-x  1 root  wheel  34 May 16 12:23 /etc/localtime ->
/usr/share/zoneinfo/Canada/Eastern

# date
Wed Jun 25 15:48:27 EDT 2014

# date -d "07/01/2014" +"%a"
Mon - Calculates the DOW as a Monday - ***INCORRECT***

I have looked at Jan 7th 2014 and it is also a Tues so it is not a parameter
order of the date issue. Nothing obvious in query-pr.

Any thoughts?

Scott.





Home | Main Index | Thread Index | Old Index