The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Filesystem ownership with zones BG_JrAdmin SUN Solaris 1 04-04-2008 06:45 AM
Zones manoj.solaris SUN Solaris 2 08-30-2007 03:17 AM
Solaris Zones Sarccastik Dude UNIX for Advanced & Expert Users 7 12-14-2006 09:08 AM
ntp across time zones Howeird UNIX for Advanced & Expert Users 5 04-11-2002 09:17 AM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-16-2001
Registered User
 

Join Date: Oct 2001
Posts: 1
Red face time zones

Hi all, this is my first post so I hope someone can help me. I am currently putting code into a script that is run through the cron on a unix box where the date/time is set to EDT or Eastern Daylight Time but I am in Central Standard time. The program I am adding code to runs every hour and I put some code in it to create a file with a date stamp on the end of it. Well the program is supposed to create a new file every day and when the day rolls over at (supposedly) midnight but midnight is not really midnight so I need a way to run a date command and pulls back the date in CST rather than EDT and I can't change the TZ environmental variable. I need to try to do this in the date command but I'm kinda stumped anybody help me with some syntax to retrieve the date in CST time and not do any calculations on the date variable with anything because I don't want to have to worry about maintaining this program if the crazy sys admin decides to change the system date back to CST??????????
Forum Sponsor
  #2 (permalink)  
Old 10-17-2001
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,334
There is no sensible reason to prohibit you from fiddling with the TZ variable. You inherit a copy of your parent's TZ variable, but if you change yours, no one else's will change. You can also spawn a child with a different value than yours if you want like this:
TZ=CST4CDT date
This works with bourne and korn shells, the c-shell doesn't allow it. But even there you can save the old value, change it, run date, and change it back.
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:00 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0