Click to See Complete Forum and Search --> : The date command


Huggy
11-26-2001, 06:24 PM
hey all
easy question.
The date command comes with all these damn
%p - gives the AM PM
%j - day of year
%H
%a
%A
bla
bla
bla
now how the hell do I use them?
I type in
date %p
and it gives me.
date: invalid date `$%p'
so who do I get it to work?
please

scanez
11-26-2001, 06:33 PM
You have to use

date +%p

with a "+" in front. But that will just give you

PM or AM.

If you want to use any formatting, you have to format the whole date like

date +%l:%M:%S/%p (which at the time of this post gives 3:32:11/PM)

or something. There are many formatting options available for date.

SC

[ 26 November 2001: Message edited by: scanez ]

Huggy
11-26-2001, 06:37 PM
thanks so its the +%p


thanks again