Visit The New, Modern Unix Linux Community

Search Results

Search: Posts Made By: Corona688
14,975
Posted By Corona688
Thanks for catching that.
Thanks for catching that.
14,975
Posted By Corona688
Hooray! I found a bug! add_months vs add_month....
Hooray! I found a bug! add_months vs add_month. Fixed in v0.1.0.
14,975
Posted By Corona688
Here it is trimmed down and made far less ugly,...
Here it is trimmed down and made far less ugly, with some bits moved into subs, subs moved down out of the way, and processing is now far less of a kludge in general. This is the next "official"...
14,975
Posted By Corona688
A few bugfixes and improvements, such as the...
A few bugfixes and improvements, such as the ability to ask it for "last week". It removes a lot of undefined behavior that happened whenever it had partial arguments. Base time and offsets are now...
14,975
Posted By Corona688
I'm not certain whether I want to depend on...
I'm not certain whether I want to depend on outside locale or even the Perl locale module; this script sees the most use as a kludge on old systems, and the only time locale generally comes up on...
14,975
Posted By Corona688
Here is v0.0.7, with a little more refined input...
Here is v0.0.7, with a little more refined input detection. It can handle more informal dates and time, like:

$ ./gdate.pl -d "Mar 10, 2016 1:51:09 PM CST"

2016-03-10 13:51:09

$ ./date.pl...
14,975
Posted By Corona688
warnings and strict added, errors corrected. ...
warnings and strict added, errors corrected. v0.0.6 now.
14,975
Posted By Corona688
Another update, with more bugfixes, some code...
Another update, with more bugfixes, some code simplifications, and a --help option. I'm keeping the most up-to-date code in the OP now.
14,975
Posted By Corona688
An updated version which supports --reference/-r:...
An updated version which supports --reference/-r:

#!/usr/bin/perl

use POSIX;

my $cmdstr="%Y-%m-%d %H:%M:%S";
my ($input, $arg, $sign, $file)=(undef, undef, 0, undef);
my...
14,975
Posted By Corona688
I get no such errors here, even when fiddling...
I get no such errors here, even when fiddling with the TZ variable (which perl appears to support). What version of perl do you use?

The real error was that the string 'now', which caused no...
14,975
Posted By Corona688
Updated. switch() removed, known bugs fixed,...
Updated. switch() removed, known bugs fixed, +formatting added.
14,975
Posted By Corona688
Bug noted, thank you a lot, I had --date...
Bug noted, thank you a lot, I had --date "something" when I should have done --date="something".

Thanks for reminding me about the +syntax feature, which I'd planned but forgotten.

Date math is...
14,975
Posted By Corona688
General Purpose Date Script
There must be thousands of one-off solutions scattered around this forum. GNU Date is so handy because it's general but if they're asking they probably don't have it. We have some nice scripts but...
Showing results 1 to 13 of 13

 

Featured Tech Videos

All times are GMT -4. The time now is 06:34 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy