Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: awk 'system...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 12 Topic 2171 of 2241
Post > Topic >>

Re: awk 'system("date +%s -d ")'

by Ed Morton <morton@[EMAIL PROTECTED] > Feb 24, 2008 at 03:23 PM

On 2/24/2008 3:06 PM, DanielC wrote:
> I tried to use awk to convert time format, but got below errors:
> 
> # awk 'BEGIN {system("date +%s -d " "09:14:03")}'
> 1203844443
> # awk 'BEGIN {system("date +%s -d " "2008-02-24 09:14:03")}'
> date: too many non-option arguments: 09:14:03
> Try `date --help' for more information.
>  

$ awk 'BEGIN {system("date +%s -d " "2008-02-24 09:14:03")}'
date: extra operand `09:14:03'
Try `date --help' for more information.
$ awk 'BEGIN {system("date +%s -d " "\"2008-02-24 09:14:03\"")}'
1203866043

Of course, with GNU awk you could just use it's built in time functions...

	Ed.




 12 Posts in Topic:
awk 'system("date +%s -d ")'
"DanielC" <d  2008-02-24 13:06:04 
Re: awk 'system("date +%s -d ")'
Ed Morton <morton@[EMA  2008-02-24 15:23:36 
Re: awk 'system("date +%s -d ")'
"DanielC" <d  2008-02-24 13:50:28 
Re: awk 'system("date +%s -d ")'
Ed Morton <morton@[EMA  2008-02-24 15:56:40 
Re: awk 'system("date +%s -d ")'
"DanielC" <d  2008-02-24 14:36:52 
Re: awk 'system("date +%s -d ")'
Ed Morton <morton@[EMA  2008-02-24 17:04:05 
Re: awk 'system("date +%s -d ")'
"DanielC" <d  2008-02-24 15:34:58 
Re: awk 'system("date +%s -d ")'
Ed Morton <morton@[EMA  2008-02-24 23:21:07 
Re: awk 'system("date +%s -d ")'
"DanielC" <d  2008-02-26 23:29:11 
Re: awk 'system("date +%s -d ")'
Janis <janis_papanagno  2008-02-27 00:56:02 
Re: awk 'system("date +%s -d ")'
dnlchen@[EMAIL PROTECTED]  2008-02-29 18:04:36 
Re: awk 'system("date +%s -d ")'
mik3l3374@[EMAIL PROTECTE  2008-02-25 01:07:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 4:26:26 CDT 2008.