|
From: Alan C. <ala...@gm...> - 2018-01-20 15:20:54
|
OK, I hadn't really tried parsing this format in Gnuplot before I don't think, I've done the more common American YY-MM-DD HH:MM:SS. I thought Gnuplot date parsing was a more complete subset of strptime and strftime. A way to ignore 1 character (at a time) would help since default date output is fixed width, but then there's that month abbreviation. %s is just so handy. Yeah, I've done stuff like adate=`date +"%Y-%m-%d_%H-%M"` outname=bp_$adate.txt for file names In the Joe editor I can do ctrl-k r like I was going to read from a file, then supply !date instead of a file name, but I still get the Sat Jan 20 09:57:00 EST 2018 format. Oh well, so I wasn't misreading the documentation. Got it. Using bash anyway. Mismash of single, double quotes and backticks: pi3# alias gdate='echo `date +"%Y-%m-%d_%H-%M"`' pi3# gdate 2018-01-20_10-11 On 1/20/18, Hans-Bernhard Bröker <HBB...@t-...> wrote: > Am 20.01.2018 um 04:28 schrieb Alan Corey: >> I'd like to be able to do date >> datafile, then edit the file to add >> other columns, and have Gnuplot understand the date/time format which >> looks like: >> >> Fri Jan 19 22:08:14 EST 2018 >> >> It seems like this must be a common thing to do. > > Not really, since the common approach would be that, if you want a > machine to parse that timestamp, you better not output it in a format > designed strictly for human consumption. Not even if that's the default > format. > > This is what date options like +'%s', -Iseconds or --rfc3339 are for, > the latter two possibly combined with -u to get absolute timestamps. > > Or better yet, see if your editor can't insert the timestamps itself, > instead of you having to do this in a two-step process. > -- ------------- No, I won't call it "climate change", do you have a "reality problem"? - AB1JX Impeach Impeach Impeach Impeach Impeach Impeach Impeach Impeach |