LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-25-2004, 11:42 AM   #1
skaa
LQ Newbie
 
Registered: Jun 2004
Location: Morton Grove, IL, USA
Posts: 4

Rep: Reputation: 0
Time Zones in Linux


How to calculate the difference between Central and Mountain times in Linux, not installing time zone on my computer?
 
Old 06-25-2004, 12:57 PM   #2
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
Maybe I don't understand your question, but Central is *always* one hour ahead of Mountain. There's really nothing to calculate, and if you know one, you would instantly know the other too. -- J.W.
 
Old 06-28-2004, 11:25 AM   #3
skaa
LQ Newbie
 
Registered: Jun 2004
Location: Morton Grove, IL, USA
Posts: 4

Original Poster
Rep: Reputation: 0
I shall have a lot of clients, not only from Mountain time zone... I shall know their zones and need to calculate difference between their and my time. I want to calculate it using some functions of Linux...
Thank you.
 
Old 06-28-2004, 11:41 AM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Maybe you could google for information on GMT plus or minus a number. For example...
I think central time is GMT-0600
 
Old 06-29-2004, 08:03 AM   #5
skaa
LQ Newbie
 
Registered: Jun 2004
Location: Morton Grove, IL, USA
Posts: 4

Original Poster
Rep: Reputation: 0
I want to get the difference between timezones from operation system,,,
 
Old 06-29-2004, 10:34 AM   #6
skaa
LQ Newbie
 
Registered: Jun 2004
Location: Morton Grove, IL, USA
Posts: 4

Original Poster
Rep: Reputation: 0
OK!!! I found. It can be done this way:

FILE *fp;
char so[4096];

fp=popen("TZ=\"Europe/Moscow\" date","r");
if(fp!=NULL)
{
fgets(so,80,fp); //Now so contains something like "Tue Jun 29 19:32:56 MSD 2004"
pclose(fp);
}

Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
XWindows time zones display equus Linux - Software 0 07-04-2004 02:42 PM
Shorewall nested zones JohnLocke Linux - Security 0 06-30-2004 12:24 AM
DNS Slave not getting zones from master tysonh04 Fedora 1 06-06-2004 05:10 PM
dns zones jmono Linux - Networking 3 05-19-2003 09:39 PM
GNOME snap zones? epitome Linux - Software 3 04-16-2003 02:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration