Solved

Time zone problem

Posted on 2004-04-13
8
281 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

740 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