473,378 Members | 1,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Possible to calculate localtime based on Country/State?

Hi all,

Does anyone know of a script or package that will allow me to calculate
the localtime given a country code (and optional state/province for
US/Canada)? It should factor in daylight saving time when applicable.
If there are special cases where country + state isn't enough that's ok,
a solution that's correct 95% of the time would be better than no
solution at all.

Thanks much,
Kevin
Aug 1 '06 #1
2 2434

Kevin wrote:
Hi all,

Does anyone know of a script or package that will allow me to calculate
the localtime given a country code (and optional state/province for
US/Canada)? It should factor in daylight saving time when applicable.
If there are special cases where country + state isn't enough that's ok,
a solution that's correct 95% of the time would be better than no
solution at all.

Thanks much,
Kevin
In unix i'm fairly sure there is a directory full of different regions
with files describing the timezones.

Otherwise, you can probably find a list of states and their timezones
relatively easily. It wouldn't be hard to hand create a list, either,
its only, what? 50-60 areas?

Aug 2 '06 #2
Kevin wrote:
Hi all,

Does anyone know of a script or package that will allow me to calculate
the localtime given a country code (and optional state/province for
US/Canada)?
<snip>

May be <http://www.twinsun.com/tz/tz-link.htm>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Aug 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phil Powell | last post by:
print_r("From index.php 20: $prefix: stateXML = $stateXML<P>"); foreach (array('state', 'country') as $prefix) { print_r("From index.php 21: stateXML = $stateXML<P>"); ${$prefix . 'XML'} =...
11
by: Laery | last post by:
Hi, I'm currently adding a new module to an old borland C3.1 application (dos). And I need to calculate a date by subtracting the number of days from a given date. I know I could use an...
5
by: Raj | last post by:
Hi I'm very new to C and am trying to get the time a month ago in the format mmyy. What I have tried so far is: char *last_mth; size_t maxsize = 4; struct tm *timeptr = localtime(time(0));
1
by: Emmanuel | last post by:
Hi, I have a webform with some input controls in it. Some of these controls have validation controls assigned. So far so good. I would like to have a validator which validates a field only if...
4
by: dmisen | last post by:
I have data on air pollution coming from sources across the country, and control options for reducing pollution from each source. The example below shows data for: - 2 sources (plant_ID "001" and...
7
by: Yuanfei | last post by:
Hi There, I just found that there is a problem in vc2005 regarding to time_t and localtime. See code snippets belows. Using this code segment, I found that when ut is 86200, the corresponding...
23
by: mosesdinakaran | last post by:
Hi All, I need a small clarification in submitting the forms, Ur suggestions please. In a page I have two form and also two submit butons. (ie)
7
by: tokcy | last post by:
Hi everyone, I need the world database of country state and city. Actually i have three drop down option in my project in 1st drop down country name should come from database and 2nd drop down...
5
by: bennever | last post by:
Hi, I plan to use drop down lists to populate team results and will use the standard country/state drop down lists as the base code. The question: how can I populate multiple (5) states from...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.