Solved

Time zone problem

Posted on 2004-04-13
8
278 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

829 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