From: Antony Pavlov <antonynpavlov@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [RFC v3 4/5] commands: add hwclock
Date: Mon, 21 Jul 2014 19:41:50 +0400 [thread overview]
Message-ID: <20140721194150.1d5ea1f772f27fb02e267f42@gmail.com> (raw)
In-Reply-To: <20140721081150.GT23235@pengutronix.de>
On Mon, 21 Jul 2014 10:11:50 +0200
Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Mon, Jul 21, 2014 at 11:10:25AM +0400, Antony Pavlov wrote:
> > On Mon, 21 Jul 2014 08:41:06 +0200
> > Sascha Hauer <s.hauer@pengutronix.de> wrote:
> >
> > > On Sun, Jul 20, 2014 at 09:55:22AM +0400, Antony Pavlov wrote:
> > > > On Sat, 19 Jul 2014 21:02:22 +0200
> > > > Holger Schurig <holgerschurig@gmail.com> wrote:
> > > >
> > > > > I'd prefer a more logical format (and that is also in the help).
> > > > > However, in this case I wouldn't name the command "hwclock", but maybe
> > > > > "setclock".
> > > >
> > > > hwclock allows to use a logical format!
> > > >
> > > > e.g. here is a quote from hwclock manpage:
> > > >
> > > > --date=date_string
> > > > You need this option if you specify the --set or --predict functions, otherwise
> > > > it is ignored. It specifies the time to which to set the Hardware Clock, or the
> > > > time for which to predict the Hardware Clock reading. The value of this option
> > > > is an argument to the date(1) program. For example:
> > > >
> > > > hwclock --set --date="2011-08-14 16:45:05"
> > >
> > > Is this format easy enough to parse? If yes, that sounds like a good
> > > format.
> >
> > So you have no objections on using a logical format :)
>
> No, not at all ;)
>
> >
> > I can make a small review on conventional date_string formats so we can discuss most appropriate one.
>
> Nice, thanks.
>
> I think we can always add additional formats using different command
> line switches, but the better we chose our default format the lesser
> need we'll have to add additional formats.
I know about at least two widespread date command realizations used with linux:
* coreutils realization;
* busybox realization.
coreutils realization
=====================
I have looked inside parse_datetime() from coreutils-8.21/lib/parse-datetime.c.
It uses yyparse() for date string parsing! The corresponding yacc description
is inside the lib/parse-datetime.y file. Can I easely steal this code for barebox? I suppose NO!
busybox realization
===================
Here is parse_datestr() (barebox.git/libbb/time.c) date format list:
#if ENABLE_FEATURE_DATE_COMPAT
/* MMDDhhmm[[CC]YY][.ss] */ --- weird 'date' format
#endif
/* HH:MM[:SS] */
/* mm.dd-HH:MM[:SS] */
/* yyyy.mm.dd-HH:MM[:SS] */
/* yyyy-mm-dd HH:MM[:SS] */
/* month_name d HH:MM:SS YYYY */ --- I suppose we don't want to mess with mount_name :)
/* yyyy-mm-dd HH */
/* yyyy-mm-dd */
/* MM[.SS] */
/* HHMM[.SS] */
/* ddHHMM[.SS] */
/* mmddHHMM[.SS] */
/* yymmddHHMM[.SS] */
/* ccyymmddHHMM[.SS] */ --- this format is used in RFCv3 patchseries.
--
Best regards,
Antony Pavlov
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-07-21 15:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-14 20:48 [RFC v3 0/5] add rtc support Antony Pavlov
2014-07-14 20:48 ` [RFC v3 1/5] lib: import 'bcd' from linux-3.15 Antony Pavlov
2014-07-14 20:48 ` [RFC v3 2/5] add rtc support Antony Pavlov
2014-07-14 20:48 ` [RFC v3 3/5] rtc: import ds1307 driver from linux-3.15 Antony Pavlov
2014-07-14 20:48 ` [RFC v3 4/5] commands: add hwclock Antony Pavlov
2014-07-18 5:44 ` Sascha Hauer
2014-07-18 7:36 ` Antony Pavlov
2014-07-19 19:02 ` Holger Schurig
2014-07-20 5:55 ` Antony Pavlov
2014-07-21 6:41 ` Sascha Hauer
2014-07-21 7:10 ` Antony Pavlov
2014-07-21 8:11 ` Sascha Hauer
2014-07-21 15:41 ` Antony Pavlov [this message]
2014-07-21 17:34 ` Antony Pavlov
2014-07-24 19:17 ` Antony Pavlov
2014-07-25 7:38 ` Sascha Hauer
2014-07-25 7:39 ` Sascha Hauer
2014-07-14 20:48 ` [RFC v3 5/5] ARM: versatilepb_defconfig: enable RTC support Antony Pavlov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140721194150.1d5ea1f772f27fb02e267f42@gmail.com \
--to=antonynpavlov@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.