From owner-freebsd-bugs@FreeBSD.ORG Wed Mar 11 20:47:57 2015 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DA399AA for ; Wed, 11 Mar 2015 20:47:57 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A09AB3A for ; Wed, 11 Mar 2015 20:47:57 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t2BKlugx014337 for ; Wed, 11 Mar 2015 20:47:56 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 198530] date(1) command: parsing of %T broken in 10.1-RELEASE Date: Wed, 11 Mar 2015 20:47:57 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 10.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: euan@potensol.com X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 20:47:57 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198530 Bug ID: 198530 Summary: date(1) command: parsing of %T broken in 10.1-RELEASE Product: Base System Version: 10.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: euan@potensol.com The parsing of a date by date(1) using the -f flag and %T is now broken in 10.1-RELEASE. I noticed it when my script that previous worked no longer does. For example, in FreeBSD 10.0-RELEASE-p7: $ date -j -f "%a %b %d %T %Y" "Thu Mar 12 3:08 2015" +%s 1426100897 But in FreeBSD 10.1-RELEASE-p0: $ date -j -f "%a %b %d %T %Y" "Thu Mar 12 3:08 2015" +%s Failed conversion of ``Thu Mar 12 3:08 2015'' using format ``%a %b %d %T %Y'' date: illegal time format usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] And from the man pages' example section, in FeeeBSD 10.1-RELEASE: $ date -j -f "%a %b %d %T %Z %Y" "`date`" "+%s" Failed conversion of ``Thu 12 Mar 2015 04:28:16 SGT'' using format ``%a %b %d %T %Z %Y'' date: illegal time format usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] I may be able to workaround / fix my script by changing the %T to %H:%M, since it seems it's the lack of the minutes that's upsetting the parser. For example, in FreeBSD 10.1-RELEASE: $ date -j -f "%a %b %d %H:%M %Y" "Thu Mar 12 3:08 2015" +%s 1426100907 The date string I'm using is from "zfs -H -o creation pool/filesytem". And the reason the man page example doesn't work is probably the timezone. In my case SGT. e.g: $ date Thu 12 Mar 2015 04:34:39 SGT Perhaps the change is intentional, to make the parser more strict. But it's not nice when a script gets broken. And the man page needs updating in any case. -- You are receiving this mail because: You are the assignee for the bug.