.NET component developers - Suggestion

B

bijoy

Here's a suggestion for a module/class that can be built and
potentially sold. I've found several companies that build and sell .NET
controls.. Here's an idea for you folks..

I've noticed multiple posting related to timezone conversion. i.e given
a time in timezone A, convert the time to timezone B, by accounting for
DST. There doesn't seem to be a clean solution for this.

I know there are classes that allow you to convert to and from UTC to
Server timezone. A class that allows conversions to and from arbitrary
timezones would be a nice to have.

To simplify it, pick only major timezones and restrict the date range -
say the next 10 years.

Bijoy
 
J

Juan T. Llibre

Two questions for you :

1.
Could you explain the difference between
major timezones and minor timezones ?

2.
restrict the date range say the next 10 years.

Please explain the difference between a date today
and a date a year from now, in terms of timezones.
 
B

bijoy

Do i sense sarcasm?

anyways,

It may be difficult to gather data for ALL timezones.. Some areas do
not have DST, others do. So I am suggesting the class handle a subset
of all timezones.

DST changes dont happen on the same day every year. Again, it may be
difficult to collect these "change dates" for an infinite number of
years.
 
A

Adrian Parker

It's a relatively simple task.. all the info you need about timezones is
stored in the windows registry.
 
B

bijoy

Kevin,

The 2nd link seems close to what I am looking for..

The MSDN article talks about converting to and from SERVER time to UTC.

The Prog Heaven seems to get the correct time from time servers
 
J

Juan T. Llibre

re:
Do i sense sarcasm?

Just two honest questions.

re:
It may be difficult to gather data for ALL timezones.
Some areas do not have DST, others do.

That's exactly why I asked.

re:
So I am suggesting the class handle
a subset of all timezones.

But I thought you were looking for a "clean solution".
Even if that was done, a simple subset would not work.

For example, in the Caribbean, several countries are
in the same timezone but some use DST and some don't.

Tracking the differences in countries which are in the same
timezone but don't use DST will take a lot of research and code.

re:
DST changes dont happen on the same day every year.

Another complication.

The control would need to distinguish in
which country it's being installed in.

Of course, providing a way to select the country might
be convenient towards resolving that, but setting up
the rules for each individual country might be a difficult task.

In my country, the whole shebang changed 2 years ago.
We used to apply DST, but now don't.

I'm sure we're not the exception.

I'm sorry if I sounded sarcastic.

I only meant to ask a couple of questions which would point
to the tough programming/maintenance tasks which such a
control would entail.

Maybe that's why there isn't one on the market ?

:)
 
J

Juan T. Llibre

Assuming the correct timezone is set, of course.

That is not guaranteed to be 100% correct.
 
A

Adrian Parker

by using the registry class.

Dim strPath As String = "Software\Microsoft\Windows NT\CurrentVersion\Time
Zones"
Dim oReg As RegistryKey = Registry.LocalMachine.OpenSubKey(strPath)
 
B

bijoy

Juan,

I agree.. there are plenty of complications to worry about when it
comes to implementing something like this..

thats why i suggested simplifying the problem by working with a subset
of timezones and restricting the time from time X to Y. won't be a
100% but hey!

I envision an object with a function like this..

public DateTime Convert(System.DateTime theDate, int srcTimeZoneID, int
destTimezoneID) {}

So, it takes as input a time, a sourcetimezone and a destTimeZoneID. it
would be called as follows:

chinaTime = myObj.Convert(someTimeVar, timezones.Pacific,
timezones.China)

Bijoy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,797
Messages
2,569,647
Members
45,378
Latest member
danzeev

Latest Threads

Top