Date: Tue, 25 May 1999 13:18:48 -0500 From: Dan Nelson <dnelson@emsphone.com> To: cjclark@home.com Cc: FreeBSD Questions <freebsd-questions@FreeBSD.ORG> Subject: Re: 'date -f' question Message-ID: <19990525131848.A17956@dan.emsphone.com> In-Reply-To: <199905251639.MAA07090@cc942873-a.ewndsr1.nj.home.com>; from "Crist J. Clark" on Tue May 25 12:39:55 GMT 1999 References: <199905251639.MAA07090@cc942873-a.ewndsr1.nj.home.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (May 25), Crist J. Clark said: > I was trying to set the date using UNIX epoch time. I do not > understand why something like the following is producing this error, > > # date -f "%s" 927065401 > Warning: Ignoring 9 extraneous characters in date string (927065401) > May 25 12:27:17 pc252 date: date set by cjc > Tue May 25 12:27:17 EDT 1999 > > Just so you know, > > # date -r 927065401 > Tue May 18 18:10:01 EDT 1999 > > So 'date' is not actually setting the time to what I ask. To figure > out how to use the '-f' option on date, one must decipher the > date(1), strptime(3), and strftime(3) manpages. Did I do so > improperly? I think the first usage of date should work. What am I > missing here? Nothing. you just found a bug in strptime. Even though the manpage states: All conversion specifications are identical to those described in strftime(3). The %s format is not parsed. Feel free to submit a PR on it, preferably with patches :) -Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990525131848.A17956>