Skip to contentSkip to conversation

date alias

DISCUSSION [email protected] 3 participants 3 messages Jun 7, 2002

lore
Share & tools
lore
#0 lore raw

Steven, others,

I've added the following to /root/.profile

alias date='date +'%cEST''

and output is Thu Jun 06 13:33:14 2002EST

I have all the reference materials I need,
but don't know where to begin looking. I'd
like to include a space between the year
and time zone (2002 EST). Am I looking at
a kind of variable? What is the %c called
in the above alias? Am I looking for something
similar to %c?

Thanks, and best regards,

John E. Jay Maass, k7jkz
suburban Philadelphia
[email protected]
http://jaywire.members.tripod.com
using Steven Darnold's BasicLinux Ver. 1.61

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#1 lore raw
Quoted 5 lines

I've added the following to /root/.profile

alias date='date +'%cEST''

and output is Thu Jun 06 13:33:14 2002EST

I'm not quite sure what you're trying to achieve here. If you just want the date in EST, then try:

export TZ=EST
date +%c

If you're root, you can set the system-wide timezone by changing /etc/localtime (on my machine, this is a symbolic link to a timezone file in /usr/share/zoneinfo). Then anyone who doesn't have a TZ environment variable gets that timezone.

Quoted 4 lines

I have all the reference materials I need, but don't know where to begin looking. I'd like to include a space between the year and time zone (2002 EST).

Try:

alias date='date "+%c EST"'

Quoted 1 line

What is the %c called in the above alias?

Depending on who you ask, they're either directives or output specifiers.

Steven Smith,
[email protected]

#2 lore raw
In reply to [email protected]
Quoted 8 lines · On Thursday 01 January 1970 05:30, [email protected] wrote:

Steven, others,

I've added the following to /root/.profile

alias date='date +'%cEST''

and output is Thu Jun 06 13:33:14 2002EST

Quoted 7 lines

I have all the reference materials I need, but don't know where to begin looking. I'd like to include a space between the year and time zone (2002 EST).  Am I looking at a kind of variable?  What is the %c called in the above alias?  Am I looking for something similar to %c?

$ man date
[snip]

%c locale's date and time (Sat Nov 04 12:02:33 EST 1989)

[snip]

$ date +"%c EST"
Fri 07 Jun 2002 03:58:20 PM IST EST

Bye,
Suriya Narayanan M S

Signature · 11 lines
Guru Brahma Gurur Vishnu
Gurur Dhevo Maheshwaraha
Gurur Saakshaath Parabramha
Thasmai Shree Gurave Namaha

Public key at www.keyserver.net
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs