UGU Unix Guru Universe
For Unix Admins, By Unix Admins
Follow ugucom on Twitter      Search  in 
Home
BEGINNERS & USERS

Events

Internet
 
 Linux
BEGINNERS & USERS
Software
Linux Vendors
Usenet NewsGroups
Books & Publications
 
 Shop
Cool Admin Gifts!
Gadgets
T-Shirts
Books
 
 Unix Guru Universe
About
Add Link
Feedback
 
 
UGU: Unix Guru Universe - Unix Tip #4032- February 25, 2012 - Home : Help : Today's Tip
Unix Tip #4032- February 25, 2012

SOLARIS CHANGING SEASONS


During a session, sometimes
we have a need to change the
system time for our session
only. We have used it to
simulate time based testing.

export TZ=ESThhEDT

The EST set your time to Eastern
Standard Time and EDT is Eastern
Daylight Time.

hh is the number of hours you
wish to change.

Example: Currently the system
date is Tue Jun 19 13:38:03 EDT 2001

and you wish to set it to
yesterday at the same time.
You would substitute a positive
29 for hh.

export TZ=EST29EDT

Now the shell time is:
Mon Jun 18 13:38:50 EDT 2001

WHY 29 and not 24? The main
UNIX clock is set from GMT not
EST therefore you have to add
5 hours to your backward
calculations to get the same
exact time since EST is
GMT - 5 hours.

Use negitive numbers to set
the clock into the future.

Also if you need to set the
minutes and seconds it is
hh:mm:ss. These are all the
number of hours, minutes and
seconds from GMT that you wish
to set.

This is for Solaris 2.6, your
mileage may vary.


NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted by various unix admins around the globe. UGU suggest you read and test each tip in a non-volitile environment before placing into production.


LAST 5 TIPS
4031 - TAR ONLY THE FILES
4030 - SHELL OUTPUT INTO VI
4029 - AVOID PERMISION DENIED
4028 - PROGRESS STATUS IN XTERM TITLEBAR
4027 - HP-UX REMOVE UNUSED SPACE


I want to SUBSCRIBE and get a UGU Tip everyday.
I want to UNSUBSCRIBE and NOT get a UGU Tip everyday.

If you have a UNIX TIP let us know, we just may use it:
(All tips become the property of the Unix Guru Universe)
Email Address:

Yes, email me a Hot Unix Tip everday.

Enter Hot Unix Tip (optional):

Yes, I will support this tip

Captcha (not case sensitive):


Please enter the above letters:

 
Copyright 1994-2024 Unix Guru Universe