On Fri, 2004-04-16 at 17:17, Matthew Seaman wrote:
> You can do it very easily with perl:
> 
>     #!/usr/bin/perl -w
> 
>     use POSIX (strftime);
> 
>     ($d = strftime("%z", localtime)) =~ s/(\d\d)(\d\d)/$1:$2/;
> 
>     print "$d\n";
> 
> but it's probably a bit too heavyweight to use perl to format the
> string if you aren't already writing a whole script in perl.  Instead,
> try:
> 
>     date +%z | sed -e 's,\([0-9][0-9]\)\([0-9][0-9]\),\1:\2,'
> 
>       Cheers,
> 
>       Matthew


Oops, didn't notice this because it was in a different thread. Well now
you  have two Perl solutions :)
-- 
Shaun Friedle

_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to