473,686 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to convert a given local time to UT considering Daylight Saving Times....

Hi group ,

I need a function to convert a given local time to the correct Universal
Time ( UTC/GMT). The problem is the Daylight Saving Times(DST). Unix/Linux
uses the Olson TZ database wich contains all the informations
about DSTs... Are there any functions wich make this for me ? Such a
function must use some location information like Longtitude to calculate the
right UTC offset. After that it needs to look for the DST in a database.
Anyone for an idea ? Maybe someone can point me to the right direction ...

Thanks for help
Filip

_______________ _______________ ___
Filip Lyncker, Dipl.-Inform. (FH)

Ingenieurbüro Lyncker & Theis GbR
Rauenthaler Straße 8
65197 Wiesbaden

Fon 0611/89038960
Fax 0611/9406125

ly*****@lyth.de
Jul 23 '05 #1
3 2436
"Filip Lyncker" writes:
I need a function to convert a given local time to the correct Universal
Time ( UTC/GMT). The problem is the Daylight Saving Times(DST). Unix/Linux
uses the Olson TZ database wich contains all the informations
about DSTs... Are there any functions wich make this for me ? Such a
function must use some location information like Longtitude to calculate
the right UTC offset. After that it needs to look for the DST in a
database.
Anyone for an idea ? Maybe someone can point me to the right direction ...


Local time is a political/governmental decision so you can't compute it from
longitude.
Jul 23 '05 #2
Local time is a political/governmental decision so you can't compute it
from
longitude.


yes , thats the reason why im talking about a database like the olson
database...


Jul 23 '05 #3
Filip Lyncker wrote:
Local time is a political/governmental decision so you can't compute it
from
longitude.


yes , thats the reason why im talking about a database like the olson
database...


OK. So what is wrong with using that 'Olson database'
A quick google search brought up some sites which
looked promising.

--
Karl Heinz Buchegger
kb******@gascad .at
Jul 23 '05 #4

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

Similar topics

6
7976
by: Dhaval | last post by:
Hi, Well I am facing this strange issue with javascript. Specifically on the 26th October 2003, when I select any roomtype I get the rate 0 if "In the Operating system, Time Zone is selected with "Automatically adjust clocks with daylight saving changes". why does this happen, please have a look at this page: http://autouae.bpweb.net/reservation.html
11
1930
by: cwdjrxyz | last post by:
Several threads have discussed the accuracy of time calculated using script when Daylight Saving Time (DST) is considered. A page at http://webexhibits.org/daylightsaving/ gives much information on DST, and how it differs in various parts of the world. There is a calculator for the US and EU systems. However there are other variations in the world. In the US, I live in the CST time zone. However this is called CDT when DST is in effect....
3
23744
by: Randall Parker | last post by:
Suppose one has a database of UTC times that are from different dates in the past. The problem with translating those times to a local time is that one does not know for each UTC time whether the local time at that same moment had daylight savings time in effect. If one has a local time it is easier to translate it into UTC time. One can get the UTC time and one can even calculate the number of hours difference between them as follows: ...
7
37686
by: Angus Comber | last post by:
Hello I need to do this conversion but can't seem to find the function. Angus
1
1996
by: luke_airig | last post by:
I'm not sure if this is the right group for this posting. If not, please accept my apologies. I have been tasked with identifying and correcting application code that will be affected by the new daylight saving time change that goes into effect 2007/03/11. This is a .Net application with thousands of lines of c#, javascript and html. As I currently understand it, relevant patches will be supplied and applied to the affected web...
1
14591
by: davelist | last post by:
I'm guessing there is an easy way to do this but I keep going around in circles in the documentation. I have a time stamp that looks like this (corresponding to UTC time): start_time = '2007-03-13T15:00:00Z' I want to convert it to my local time. start_time = time.mktime(time.strptime(start_time, '%Y-%m-%dT%H:%M:
2
1868
by: Mr Pekka Niiranen | last post by:
Hi, is it possible to get the two annual daylight saving times (day, month and time) from Python by giving location in some country/location string ("Europe/Finland" for example). I need to ask country in program and calculate daylight saving times for the next few years onwards somehow like this: for y in range(2007, 2017):
3
3973
by: bernhard Hoyler | last post by:
Hi, I would like to determine whether at a certain time point in time the daylight savings time is in effect. This means such a logic should show that today (16-Nov-2007) no daylight savings time (or European summertime) is in effect, but at 1-Aug-2007 it is. Thanks for your help Bernhard Hoyler
2
2458
by: andreas.profous | last post by:
Hi all, I have the following problem: There are strings describing a UTC time, e.g. " 2008-01-15 22:32:30" and a string reflecting the time zone e.g. "-05:00". What is an elegant way of getting the local time (considering DST - daylight saving time) with that data? The date is not important, just the local time.
0
9057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8936
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8772
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8780
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7603
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6442
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.