Solved

Time zone problem

Posted on 2004-04-13
8
275 Views
Last Modified: 2010-04-21
I am working on time zones here. Does unix provide any utility which gives difference bet UST and local times in terms of secs.

I am ware of the TZ varibale which gives me the diff, but i want something in seconds.
0
Comment
Question by:raj_paps
8 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 10817337
Timezones are all integer multiples of an hour. So if you know the offset from GMT just multiply by 3600 to get the offset in seconds.
0
 
LVL 5

Expert Comment

by:mrfixit22
ID: 10818488
You can see if one of these are available gettimeofday(), ftime(), time()
0
 
LVL 48

Expert Comment

by:Tintin
ID: 10818776
Not all timezones are multiples of an hour.  There are a number of timezones that are 30 mins diff and even one that is 45 mins (from memory).

raj_paps, are you willing to use Perl?
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:raj_paps
ID: 10820157
I am using a properiety language here.
Just want to know is there any env variable in Unix which gives me time zone diff in seconds..?
0
 
LVL 48

Accepted Solution

by:
Tintin earned 125 total points
ID: 10820198
No.  There are no environment variables that can give you that information.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10822435
> .. is there any env variable in Unix which gives me time zone diff in seconds
no.
0
 

Author Comment

by:raj_paps
ID: 10823597
Thanx for the help....
Unix does not give anything in seconds..Please close this question
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question