Newbie needs help changing date format

2004-08-26 Thread John Bruin
Hi I have a list of dates that have been converted to epoch seconds, processed and then converted back to a string (using timelocal). The resulting date format is:- Wed Mar 16 22:10:16 2004 What is the easiest way to convert this format (or epoch seconds) to 16-Mar-2004 22:10 - preferrably

Re: Newbie needs help changing date format

2004-08-26 Thread Wiggins d Anconia
Hi I have a list of dates that have been converted to epoch seconds, processed and then converted back to a string (using timelocal). The resulting date format is:- Wed Mar 16 22:10:16 2004 What is the easiest way to convert this format (or epoch seconds) to 16-Mar-2004 22:10 -

Re: Newbie needs help changing date format

2004-08-26 Thread Gunnar Hjalmarsson
John Bruin wrote: I have a list of dates that have been converted to epoch seconds, processed and then converted back to a string (using timelocal). The resulting date format is:- Wed Mar 16 22:10:16 2004 What is the easiest way to convert this format (or epoch seconds) to 16-Mar-2004 22:10 - The

RE: Newbie needs help changing date format

2004-08-26 Thread John Bruin
9:35 a.m. To: John Bruin; [EMAIL PROTECTED] Subject: Re: Newbie needs help changing date format Hi I have a list of dates that have been converted to epoch seconds, processed and then converted back to a string (using timelocal). The resulting date format is:- Wed Mar 16 22:10:16 2004

Help on Date Format

2001-04-24 Thread Arante, Susan
Could someone tell me why this is happening? When I use this command, it used to give me 20010405.doc (mmdd.doc), now it's giving me 2001 4 5.doc - I'm losing the leading zeros. Command is on Perl 5 - printf(\%s%02s%02s.doc,$year,$month,$day). Thanks.

Re: Help on Date Format

2001-04-24 Thread Casey West
On Tue, Apr 24, 2001 at 11:00:40AM -0500, Arante, Susan wrote: : Could someone tell me why this is happening? When I use this command, it : used to give me 20010405.doc (mmdd.doc), now it's giving me 2001 4 5.doc : - I'm losing the leading zeros. : Command is on Perl 5 -

Re: Help on Date Format

2001-04-24 Thread Kevin Meltzer
Hi Susan, I get what you expect: perl -wle '$y=2001;$m=4;$d=5;printf(\%s%02s%02s.doc,$y,$m,$d)'; 20010405.doc Personally, I like POSIX.pm for dates. # perl -MPOSIX -wle 'print strftime(%Y%m%d, localtime) . .doc'; 20010424.doc 'perldoc POSIX' to learn more (look for strftime). Cheers, Kevin

RE: Help on Date Format

2001-04-24 Thread Arante, Susan
: Help on Date Format Hi Susan, I get what you expect: perl -wle '$y=2001;$m=4;$d=5;printf(\%s%02s%02s.doc,$y,$m,$d)'; 20010405.doc Personally, I like POSIX.pm for dates. # perl -MPOSIX -wle 'print strftime(%Y%m%d, localtime) . .doc'; 20010424.doc 'perldoc POSIX' to learn more (look for strftime

Re: Help on Date Format

2001-04-24 Thread John Joseph Trammell
On Tue, Apr 24, 2001 at 01:09:13PM -0400, Kevin Meltzer wrote: Hi Susan, I get what you expect: perl -wle '$y=2001;$m=4;$d=5;printf(\%s%02s%02s.doc,$y,$m,$d)'; 20010405.doc [snip] Well I'll be damned. [ ~ ] perl -e 'printf %04s\n, 1' 0001 [ ~ ] perl -e 'printf %04s\n, 1' 0001 [ ~ ]

Re: Help on Date Format

2001-04-24 Thread Kevin Meltzer
In this case, it wont really matter. Since 1 and 1 is essentially the same. If you were actually using a signed integer (in decimal), then you would see the difference: From perldoc -f sprintf: %s a string %d a signed integer, in decimal [root@fluffhead /]# perl -e 'printf %04s\n,