Operating System - HP-UX
1827807 Members
2741 Online
109969 Solutions
New Discussion

what's diffent between date and date -u

 
SOLVED
Go to solution
thebeatlesguru
Regular Advisor

what's diffent between date and date -u

look my unix output first:
[root@dm2-px:/etc]#date -u
Fri Feb 22 06:15:02 UTC 2002
[root@dm2-px:/etc]#date
Fri Feb 22 14:15:15 EAT 2002

why are they diffent?
my /etc/TIMEZONE is:
TZ=EAT-8
export TZ

hihi
4 REPLIES 4
Deepak Extross
Honored Contributor
Solution

Re: what's diffent between date and date -u

man date:

date recognizes the following option:
-u Input and output values in Coordinated Universal Time (UTC), functionally equivalent to Greenwich Mean Time (GMT), instead of in local time.
Hartmut Lang
Trusted Contributor

Re: what's diffent between date and date -u

man date:
-u Input and output values in Coordinated Universal Time (UTC), functionally equivalent to Greenwich Mean Time (GMT),
instead of in local time.

Your local time is 8 hours ahead of UTC (EAT-8). That makes the difference.

Hardy
RAJESH GANGADHARAN
Regular Advisor

Re: what's diffent between date and date -u

date will give you current HP UX time
where as date -u will display GMT
-Raj
Let the choices you make today be the choices you can live with tomorrow.
Kenny Chau
Trusted Contributor

Re: what's diffent between date and date -u

Here is part of the man page of date:

DESCRIPTION
The date command displays or sets the current HP-UX system clock date and time. Since the HP-UX system operates in Coordinated Universal Time (UTC), date automatically converts to and from local standard or daylight/summer time, based on your TZ environment variable. See Environment Variables in EXTERNAL INFLUENCES below.

Options
date recognizes the following option:

-u Input and output values in coordinated Universal Time (UTC), functionally equivalent to Greenwich Mean Time (GMT), instead of in local time.

Hope this helps.
Kenny.
Kenny