• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

Time zone problem

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
raj_paps
Asked:
raj_paps
1 Solution
 
jlevieCommented:
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
 
mrfixit22Commented:
You can see if one of these are available gettimeofday(), ftime(), time()
0
 
TintinCommented:
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
raj_papsAuthor Commented:
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
 
TintinCommented:
No.  There are no environment variables that can give you that information.
0
 
ahoffmannCommented:
> .. is there any env variable in Unix which gives me time zone diff in seconds
no.
0
 
raj_papsAuthor Commented:
Thanx for the help....
Unix does not give anything in seconds..Please close this question
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now