[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [BusyBox] sugestion: date -d  extension
From:       walter harms <wharms () bfs ! de>
Date:       2005-05-31 8:06:17
Message-ID: 429C1AF9.30702 () bfs ! de
[Download RAW message or body]

hi list,
hi rob,

i drop over the problem with these example

gnudate:
date -d "2005-01-01 10:00:00" +"%s"

bbdate:
date -d "2005-01-01 10:00:00" +"%s"
date: invalid date `2005-01-01 10:00:00'

or this fancy trick to convert between Epoch and localtime
(from gnu date examples)

date -d '1970-01-01 UTC 946684800 seconds' +"%Y-%m-%d %T %z"
2000-01-01 01:00:00 +0100

date -d '1970-01-01 UTC 946684800 seconds' +"%Y-%m-%d %T %z"
date: invalid date `1970-01-01 UTC 946684800 seconds'


by looking at the code i came up with the idea to add a 'hint' to ease 
the conversion since most times ppl are aware what the input format is 
like. The point is that the gnu date conversion is very powerfull but
IMHO overkill for busybox.

I use 'date' for a lot of conversion between different formats. some
equipment have 'interessting' ideas about timeformat. we use Epoch
to store data (so i need the conversion often).

re,
	walter



Rob Landley wrote:
> On Monday 30 May 2005 08:59 am, walter harms wrote:
> 
>>Hi list,
>>i needed to convert (2005-05-30) ISO Date int Epoch. unfortunaly date -d
>>has a fixed list of conversion and simply tries to convert.
> 
> 
> If you'd given an example of a problem case you were having from the command 
> line (with gnu date I can do this: <snippet> and get <snippet> as a result, 
> but in busybox the closest I can get is <snippet> which returns <snippet>) 
> then I might care about this.  At it is, I have _no_ idea what you're talking 
> about.  You just posted a proposed solution to an unknown (nonexistent?) 
> problem...
> 
> Rob
> 
> 
> 


_______________________________________________
busybox mailing list
busybox@mail.busybox.net
http://codepoet.org/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic