473,804 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TimeZone and DateTime - what were they thinking?

TimeZone - the only instance you can get is one representing the local time
zone
DateTime - cannot represent a time before 00:00:00 1 Jan 1 CE

What were they thinking? This is a serious question - can anyone come up
with a good reason for these incredible design restrictions?

Michael Brumm http://michaelbrumm.com has produced a fix for the first
problem with his SimpleTimeZone class - good on you, Michael!

Any thoughts on how to deal with the second problem?

Cheers

- rick cameron

Jul 21 '05 #1
9 3578
Hi Rick! Long time no see....

For #1, you already know the answer -- it is based on the OS support, which
has this limitation. I do like Michael's SimpleTimeZone, but there are still
issues that are kind of inherent in some of the fundamental instabilities of
time zones as a whole. The most important note is that Michael himself
recommends always using UTC and then converting to local time for display
ONLY -- which is what MS had advocated since the beginning, what they use in
AD and email, and what actually causes the SimpleTimeZone to be able (in
most cases) from a requirement to an optional cool feature.

For #2, its hard to understand the meaning of Gregorian calendar dates
before the calendar existed. Maybe you could explain the actual scenario and
how you would account for the lack of the actual calendar for the dates you
want to represent?
--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.
"rick cameron" <ri**********@d ecisionscrystal .com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
TimeZone - the only instance you can get is one representing the local time zone
DateTime - cannot represent a time before 00:00:00 1 Jan 1 CE

What were they thinking? This is a serious question - can anyone come up
with a good reason for these incredible design restrictions?

Michael Brumm http://michaelbrumm.com has produced a fix for the first
problem with his SimpleTimeZone class - good on you, Michael!

Any thoughts on how to deal with the second problem?

Cheers

- rick cameron

Jul 21 '05 #2
Hi Rick! Long time no see....

For #1, you already know the answer -- it is based on the OS support, which
has this limitation. I do like Michael's SimpleTimeZone, but there are still
issues that are kind of inherent in some of the fundamental instabilities of
time zones as a whole. The most important note is that Michael himself
recommends always using UTC and then converting to local time for display
ONLY -- which is what MS had advocated since the beginning, what they use in
AD and email, and what actually causes the SimpleTimeZone to be able (in
most cases) from a requirement to an optional cool feature.

For #2, its hard to understand the meaning of Gregorian calendar dates
before the calendar existed. Maybe you could explain the actual scenario and
how you would account for the lack of the actual calendar for the dates you
want to represent?
--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.
"rick cameron" <ri**********@d ecisionscrystal .com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
TimeZone - the only instance you can get is one representing the local time zone
DateTime - cannot represent a time before 00:00:00 1 Jan 1 CE

What were they thinking? This is a serious question - can anyone come up
with a good reason for these incredible design restrictions?

Michael Brumm http://michaelbrumm.com has produced a fix for the first
problem with his SimpleTimeZone class - good on you, Michael!

Any thoughts on how to deal with the second problem?

Cheers

- rick cameron

Jul 21 '05 #3
Hi again, Michael

#1 - It's too bad that this is one of the places where the .NET Framework
designers decided to limit themselves to what is supported by the O/S,
rather than providing an extended implementation that fill out the model to
its logical conclusion. A scenario where this would be really useful is when
software is running on a server and must format a time according to the
conventions appropriate for a remote client - including time zone.

#2 - The DateTime class already supports dates that go back before the
earliest date that can be represented in any of the Win32 and Ole formats.
It goes back to well before the introduction of the Gregorian calendar
(which happened around 1750). But it stops, rather arbitrarily, at 1 Jan 1
CE. If you're going back that far, why not support dates BCE up to the limit
of the implementation?

This limitation makes it impossible to work with dates before year 3761 in
the Hebrew calendar. (Actually, the .NET implementation of the Hebrew
calendar is even more limited - it only works with dates between years 5343
and 6000).

The implementation of DateTime and of date formatting code obviously extends
what's available in Win32 or Ole - so why impose these arbitrary limits?

Cheers

- rick

"Michael (michka) Kaplan [MS]" <mi*****@online .microsoft.com> wrote in
message news:ed******** ******@tk2msftn gp13.phx.gbl...
Hi Rick! Long time no see....

For #1, you already know the answer -- it is based on the OS support, which has this limitation. I do like Michael's SimpleTimeZone, but there are still issues that are kind of inherent in some of the fundamental instabilities of time zones as a whole. The most important note is that Michael himself
recommends always using UTC and then converting to local time for display
ONLY -- which is what MS had advocated since the beginning, what they use in AD and email, and what actually causes the SimpleTimeZone to be able (in
most cases) from a requirement to an optional cool feature.

For #2, its hard to understand the meaning of Gregorian calendar dates
before the calendar existed. Maybe you could explain the actual scenario and how you would account for the lack of the actual calendar for the dates you want to represent?
--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.
"rick cameron" <ri**********@d ecisionscrystal .com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
TimeZone - the only instance you can get is one representing the local

time
zone
DateTime - cannot represent a time before 00:00:00 1 Jan 1 CE

What were they thinking? This is a serious question - can anyone come up
with a good reason for these incredible design restrictions?

Michael Brumm http://michaelbrumm.com has produced a fix for the first
problem with his SimpleTimeZone class - good on you, Michael!

Any thoughts on how to deal with the second problem?

Cheers

- rick cameron


Jul 21 '05 #4
Hi Rick,

Generally, we use the B.C. calenders seldomly. So the DateTime structure is
designed for convenience. If you need to represent the A.D. dates you can
try the System.Globaliz ation.Gregorian Calendar class.

Please refer to the following link for more information:

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemglob alizationgregor iancalendarclas stopic.asp

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: "rick cameron" <ri**********@d ecisionscrystal .com>
| References: <#1************ **@TK2MSFTNGP12 .phx.gbl>
<ed************ **@tk2msftngp13 .phx.gbl>
| Subject: Re: TimeZone and DateTime - what were they thinking?
| Date: Mon, 13 Oct 2003 21:04:50 -0700
| Lines: 85
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#6************ **@TK2MSFTNGP09 .phx.gbl>
| Newsgroups:
microsoft.publi c.dotnet.framew ork,microsoft.p ublic.dotnet.fr amework.clr,mic r
osoft.public.do tnet.general
| NNTP-Posting-Host: d142-173-9-56.bchsia.telus .net 142.173.9.56
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.clr:8293
microsoft.publi c.dotnet.genera l:111703
microsoft.publi c.dotnet.framew ork:56069
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| Hi again, Michael
|
| #1 - It's too bad that this is one of the places where the .NET Framework
| designers decided to limit themselves to what is supported by the O/S,
| rather than providing an extended implementation that fill out the model
to
| its logical conclusion. A scenario where this would be really useful is
when
| software is running on a server and must format a time according to the
| conventions appropriate for a remote client - including time zone.
|
| #2 - The DateTime class already supports dates that go back before the
| earliest date that can be represented in any of the Win32 and Ole formats.
| It goes back to well before the introduction of the Gregorian calendar
| (which happened around 1750). But it stops, rather arbitrarily, at 1 Jan 1
| CE. If you're going back that far, why not support dates BCE up to the
limit
| of the implementation?
|
| This limitation makes it impossible to work with dates before year 3761 in
| the Hebrew calendar. (Actually, the .NET implementation of the Hebrew
| calendar is even more limited - it only works with dates between years
5343
| and 6000).
|
| The implementation of DateTime and of date formatting code obviously
extends
| what's available in Win32 or Ole - so why impose these arbitrary limits?
|
| Cheers
|
| - rick
|
| "Michael (michka) Kaplan [MS]" <mi*****@online .microsoft.com> wrote in
| message news:ed******** ******@tk2msftn gp13.phx.gbl...
| > Hi Rick! Long time no see....
| >
| > For #1, you already know the answer -- it is based on the OS support,
| which
| > has this limitation. I do like Michael's SimpleTimeZone, but there are
| still
| > issues that are kind of inherent in some of the fundamental
instabilities
| of
| > time zones as a whole. The most important note is that Michael himself
| > recommends always using UTC and then converting to local time for
display
| > ONLY -- which is what MS had advocated since the beginning, what they
use
| in
| > AD and email, and what actually causes the SimpleTimeZone to be able (in
| > most cases) from a requirement to an optional cool feature.
| >
| > For #2, its hard to understand the meaning of Gregorian calendar dates
| > before the calendar existed. Maybe you could explain the actual scenario
| and
| > how you would account for the lack of the actual calendar for the dates
| you
| > want to represent?
| >
| >
| > --
| > MichKa [MS]
| >
| > This posting is provided "AS IS" with
| > no warranties, and confers no rights.
| >
| >
| > "rick cameron" <ri**********@d ecisionscrystal .com> wrote in message
| > news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
| > > TimeZone - the only instance you can get is one representing the local
| > time
| > > zone
| > > DateTime - cannot represent a time before 00:00:00 1 Jan 1 CE
| > >
| > > What were they thinking? This is a serious question - can anyone come
up
| > > with a good reason for these incredible design restrictions?
| > >
| > > Michael Brumm http://michaelbrumm.com has produced a fix for the first
| > > problem with his SimpleTimeZone class - good on you, Michael!
| > >
| > > Any thoughts on how to deal with the second problem?
| > >
| > > Cheers
| > >
| > > - rick cameron
| > >
| > >
| > >
| >
| >
|
|
|

Jul 21 '05 #5
Hi, Kevin

Thanks for your reply.

Although I don't often need to work with dates BCE myself, occasionally our
customers have requested this.

Another problem that arises from this limit on DateTime is that the
java.util.Date class in J# does not conform to the Java specification, in
that it does not support the range of dates specified.

Cheers

- rick

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:AJ******** *****@cpmsftngx a06.phx.gbl...
Hi Rick,

Generally, we use the B.C. calenders seldomly. So the DateTime structure is designed for convenience. If you need to represent the A.D. dates you can
try the System.Globaliz ation.Gregorian Calendar class.

Please refer to the following link for more information:

http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfsystemglob alizationgregor iancalendarclas stopic.asp

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: "rick cameron" <ri**********@d ecisionscrystal .com>
| References: <#1************ **@TK2MSFTNGP12 .phx.gbl>
<ed************ **@tk2msftngp13 .phx.gbl>
| Subject: Re: TimeZone and DateTime - what were they thinking?
| Date: Mon, 13 Oct 2003 21:04:50 -0700
| Lines: 85
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#6************ **@TK2MSFTNGP09 .phx.gbl>
| Newsgroups:
microsoft.publi c.dotnet.framew ork,microsoft.p ublic.dotnet.fr amework.clr,mic r osoft.public.do tnet.general
| NNTP-Posting-Host: d142-173-9-56.bchsia.telus .net 142.173.9.56
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.clr:8293
microsoft.publi c.dotnet.genera l:111703
microsoft.publi c.dotnet.framew ork:56069
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| Hi again, Michael
|
| #1 - It's too bad that this is one of the places where the .NET Framework | designers decided to limit themselves to what is supported by the O/S,
| rather than providing an extended implementation that fill out the model
to
| its logical conclusion. A scenario where this would be really useful is
when
| software is running on a server and must format a time according to the
| conventions appropriate for a remote client - including time zone.
|
| #2 - The DateTime class already supports dates that go back before the
| earliest date that can be represented in any of the Win32 and Ole formats. | It goes back to well before the introduction of the Gregorian calendar
| (which happened around 1750). But it stops, rather arbitrarily, at 1 Jan 1 | CE. If you're going back that far, why not support dates BCE up to the
limit
| of the implementation?
|
| This limitation makes it impossible to work with dates before year 3761 in | the Hebrew calendar. (Actually, the .NET implementation of the Hebrew
| calendar is even more limited - it only works with dates between years
5343
| and 6000).
|
| The implementation of DateTime and of date formatting code obviously
extends
| what's available in Win32 or Ole - so why impose these arbitrary limits?
|
| Cheers
|
| - rick
|
| "Michael (michka) Kaplan [MS]" <mi*****@online .microsoft.com> wrote in
| message news:ed******** ******@tk2msftn gp13.phx.gbl...
| > Hi Rick! Long time no see....
| >
| > For #1, you already know the answer -- it is based on the OS support,
| which
| > has this limitation. I do like Michael's SimpleTimeZone, but there are
| still
| > issues that are kind of inherent in some of the fundamental
instabilities
| of
| > time zones as a whole. The most important note is that Michael himself
| > recommends always using UTC and then converting to local time for
display
| > ONLY -- which is what MS had advocated since the beginning, what they
use
| in
| > AD and email, and what actually causes the SimpleTimeZone to be able (in | > most cases) from a requirement to an optional cool feature.
| >
| > For #2, its hard to understand the meaning of Gregorian calendar dates
| > before the calendar existed. Maybe you could explain the actual scenario | and
| > how you would account for the lack of the actual calendar for the dates | you
| > want to represent?
| >
| >
| > --
| > MichKa [MS]
| >
| > This posting is provided "AS IS" with
| > no warranties, and confers no rights.
| >
| >
| > "rick cameron" <ri**********@d ecisionscrystal .com> wrote in message
| > news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
| > > TimeZone - the only instance you can get is one representing the local | > time
| > > zone
| > > DateTime - cannot represent a time before 00:00:00 1 Jan 1 CE
| > >
| > > What were they thinking? This is a serious question - can anyone come up
| > > with a good reason for these incredible design restrictions?
| > >
| > > Michael Brumm http://michaelbrumm.com has produced a fix for the first | > > problem with his SimpleTimeZone class - good on you, Michael!
| > >
| > > Any thoughts on how to deal with the second problem?
| > >
| > > Cheers
| > >
| > > - rick cameron
| > >
| > >
| > >
| >
| >
|
|
|

Jul 21 '05 #6
Hi Rick,

I'm not quite familiar with java. According to the Java Language
Specification from MSDN
(http://msdn.microsoft.com/library/de...-us/vjref98/ht
ml/21_3.asp), we can see that the java.util.Date class might have the same
range as System.DateTime . So it might not support the B.C. dates.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: "rick cameron" <ri**********@d ecisionscrystal .com>
| References: <#1************ **@TK2MSFTNGP12 .phx.gbl>
<ed************ **@tk2msftngp13 .phx.gbl>
<#6************ **@TK2MSFTNGP09 .phx.gbl>
<AJ************ *@cpmsftngxa06. phx.gbl>
| Subject: Re: TimeZone and DateTime - what were they thinking?
| Date: Tue, 14 Oct 2003 09:22:46 -0700
| Lines: 166
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OF************ **@tk2msftngp13 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.genera l
| NNTP-Posting-Host: user.seagatesof tware.com 204.50.113.28
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:111791
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| Hi, Kevin
|
| Thanks for your reply.
|
| Although I don't often need to work with dates BCE myself, occasionally
our
| customers have requested this.
|
| Another problem that arises from this limit on DateTime is that the
| java.util.Date class in J# does not conform to the Java specification, in
| that it does not support the range of dates specified.
|
| Cheers
|
| - rick
|
| "Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
| news:AJ******** *****@cpmsftngx a06.phx.gbl...
| > Hi Rick,
| >
| > Generally, we use the B.C. calenders seldomly. So the DateTime structure
| is
| > designed for convenience. If you need to represent the A.D. dates you
can
| > try the System.Globaliz ation.Gregorian Calendar class.
| >
| > Please refer to the following link for more information:
| >
| >
|
http://msdn.microsoft.com/library/de...us/cpref/html/
| > frlrfsystemglob alizationgregor iancalendarclas stopic.asp
| >
| > Kevin Yu
| > =======
| > "This posting is provided "AS IS" with no warranties, and confers no
| > rights."
| >
| > --------------------
| > | From: "rick cameron" <ri**********@d ecisionscrystal .com>
| > | References: <#1************ **@TK2MSFTNGP12 .phx.gbl>
| > <ed************ **@tk2msftngp13 .phx.gbl>
| > | Subject: Re: TimeZone and DateTime - what were they thinking?
| > | Date: Mon, 13 Oct 2003 21:04:50 -0700
| > | Lines: 85
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <#6************ **@TK2MSFTNGP09 .phx.gbl>
| > | Newsgroups:
| >
|
microsoft.publi c.dotnet.framew ork,microsoft.p ublic.dotnet.fr amework.clr,mic r
| > osoft.public.do tnet.general
| > | NNTP-Posting-Host: d142-173-9-56.bchsia.telus .net 142.173.9.56
| > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| > | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.clr:8293
| > microsoft.publi c.dotnet.genera l:111703
| > microsoft.publi c.dotnet.framew ork:56069
| > | X-Tomcat-NG: microsoft.publi c.dotnet.genera l
| > |
| > | Hi again, Michael
| > |
| > | #1 - It's too bad that this is one of the places where the .NET
| Framework
| > | designers decided to limit themselves to what is supported by the O/S,
| > | rather than providing an extended implementation that fill out the
model
| > to
| > | its logical conclusion. A scenario where this would be really useful
is
| > when
| > | software is running on a server and must format a time according to
the
| > | conventions appropriate for a remote client - including time zone.
| > |
| > | #2 - The DateTime class already supports dates that go back before the
| > | earliest date that can be represented in any of the Win32 and Ole
| formats.
| > | It goes back to well before the introduction of the Gregorian calendar
| > | (which happened around 1750). But it stops, rather arbitrarily, at 1
Jan
| 1
| > | CE. If you're going back that far, why not support dates BCE up to the
| > limit
| > | of the implementation?
| > |
| > | This limitation makes it impossible to work with dates before year
3761
| in
| > | the Hebrew calendar. (Actually, the .NET implementation of the Hebrew
| > | calendar is even more limited - it only works with dates between years
| > 5343
| > | and 6000).
| > |
| > | The implementation of DateTime and of date formatting code obviously
| > extends
| > | what's available in Win32 or Ole - so why impose these arbitrary
limits?
| > |
| > | Cheers
| > |
| > | - rick
| > |
| > | "Michael (michka) Kaplan [MS]" <mi*****@online .microsoft.com> wrote in
| > | message news:ed******** ******@tk2msftn gp13.phx.gbl...
| > | > Hi Rick! Long time no see....
| > | >
| > | > For #1, you already know the answer -- it is based on the OS
support,
| > | which
| > | > has this limitation. I do like Michael's SimpleTimeZone, but there
are
| > | still
| > | > issues that are kind of inherent in some of the fundamental
| > instabilities
| > | of
| > | > time zones as a whole. The most important note is that Michael
himself
| > | > recommends always using UTC and then converting to local time for
| > display
| > | > ONLY -- which is what MS had advocated since the beginning, what
they
| > use
| > | in
| > | > AD and email, and what actually causes the SimpleTimeZone to be able
| (in
| > | > most cases) from a requirement to an optional cool feature.
| > | >
| > | > For #2, its hard to understand the meaning of Gregorian calendar
dates
| > | > before the calendar existed. Maybe you could explain the actual
| scenario
| > | and
| > | > how you would account for the lack of the actual calendar for the
| dates
| > | you
| > | > want to represent?
| > | >
| > | >
| > | > --
| > | > MichKa [MS]
| > | >
| > | > This posting is provided "AS IS" with
| > | > no warranties, and confers no rights.
| > | >
| > | >
| > | > "rick cameron" <ri**********@d ecisionscrystal .com> wrote in message
| > | > news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
| > | > > TimeZone - the only instance you can get is one representing the
| local
| > | > time
| > | > > zone
| > | > > DateTime - cannot represent a time before 00:00:00 1 Jan 1 CE
| > | > >
| > | > > What were they thinking? This is a serious question - can anyone
| come
| > up
| > | > > with a good reason for these incredible design restrictions?
| > | > >
| > | > > Michael Brumm http://michaelbrumm.com has produced a fix for the
| first
| > | > > problem with his SimpleTimeZone class - good on you, Michael!
| > | > >
| > | > > Any thoughts on how to deal with the second problem?
| > | > >
| > | > > Cheers
| > | > >
| > | > > - rick cameron
| > | > >
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|

Jul 21 '05 #7
Hi, Kevin

I haven't been able to find a place in the Java specification on Sun's
website where the valid range for Date is mentioned. Nonetheless, the
implementation of the class in the JDK supports BCE dates.

In any case, lack of compatibility with Java is not the main point I'm
trying to make. That point is just this: the TimeZone and DateTime classes
both have arbitrary limits. In the case of TimeZone, this is a real problem
for people trying to write software to run on a server. The documentation
gives no justification for these limits.

I'm sure you don't know the reason for the limits, either. It's buried in
the head of the programmer who designed these classes.

If you can pass on the suggestion that these classes be enhanced in the next
version of the .NET libraries - in particular, that TimeZone support all of
the current time zones, not just the local one, and that DateTime have the
arbitrary limits on its range (1 CE to 9999 CE) removed) I would be very
grateful.

Thanks

- rick

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:Xb******** ******@cpmsftng xa06.phx.gbl...
Hi Rick,

I'm not quite familiar with java. According to the Java Language
Specification from MSDN
(http://msdn.microsoft.com/library/de...-us/vjref98/ht ml/21_3.asp), we can see that the java.util.Date class might have the same
range as System.DateTime . So it might not support the B.C. dates.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #8
Hi Rick,

I will pass your suggestion through an appropriate channel. Thank you very
much for your advice!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: "rick cameron" <ri**********@d ecisionscrystal .com>
| References: <#1************ **@TK2MSFTNGP12 .phx.gbl>
<ed************ **@tk2msftngp13 .phx.gbl>
<#6************ **@TK2MSFTNGP09 .phx.gbl>
<AJ************ *@cpmsftngxa06. phx.gbl>
<OF************ **@tk2msftngp13 .phx.gbl>
<Xb************ **@cpmsftngxa06 .phx.gbl>
| Subject: Re: TimeZone and DateTime - what were they thinking?
| Date: Wed, 15 Oct 2003 09:29:28 -0700
| Lines: 43
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#T************ **@TK2MSFTNGP11 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.genera l
| NNTP-Posting-Host: user.seagatesof tware.com 204.50.113.28
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:112003
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| Hi, Kevin
|
| I haven't been able to find a place in the Java specification on Sun's
| website where the valid range for Date is mentioned. Nonetheless, the
| implementation of the class in the JDK supports BCE dates.
|
| In any case, lack of compatibility with Java is not the main point I'm
| trying to make. That point is just this: the TimeZone and DateTime classes
| both have arbitrary limits. In the case of TimeZone, this is a real
problem
| for people trying to write software to run on a server. The documentation
| gives no justification for these limits.
|
| I'm sure you don't know the reason for the limits, either. It's buried in
| the head of the programmer who designed these classes.
|
| If you can pass on the suggestion that these classes be enhanced in the
next
| version of the .NET libraries - in particular, that TimeZone support all
of
| the current time zones, not just the local one, and that DateTime have the
| arbitrary limits on its range (1 CE to 9999 CE) removed) I would be very
| grateful.
|
| Thanks
|
| - rick
|
| "Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
| news:Xb******** ******@cpmsftng xa06.phx.gbl...
| > Hi Rick,
| >
| > I'm not quite familiar with java. According to the Java Language
| > Specification from MSDN
| >
|
(http://msdn.microsoft.com/library/de...-us/vjref98/ht
| > ml/21_3.asp), we can see that the java.util.Date class might have the
same
| > range as System.DateTime . So it might not support the B.C. dates.
| >
| > Kevin Yu
| > =======
| > "This posting is provided "AS IS" with no warranties, and confers no
| > rights."
| >
|
|
|

Jul 21 '05 #9
"rick cameron" <ri**********@d ecisionscrystal .com> wrote...
#1 - It's too bad that this is one of the places where the .NET Framework
designers decided to limit themselves to what is supported by the O/S,
rather than providing an extended implementation that fill out the model to its logical conclusion. A scenario where this would be really useful is when software is running on a server and must format a time according to the
conventions appropriate for a remote client - including time zone.
Well, I understand what you are saying here, and I was not on on the team
that did this but I think it probably was not based so much on being "as
limited as the OS" for no reason, so much as that is what the implementation
was doing. Note that they do extend it some, and it ends up causing
confusion when the OS and the Framework give two different answers....
#2 - The DateTime class already supports dates that go back before the
earliest date that can be represented in any of the Win32 and Ole formats.
It goes back to well before the introduction of the Gregorian calendar
(which happened around 1750). But it stops, rather arbitrarily, at 1 Jan 1
CE. If you're going back that far, why not support dates BCE up to the limit of the implementation?
Well, again I am not on that team so I cannot really explain why. I doubt
the reasons are arbitrary, though.... FWIW.
This limitation makes it impossible to work with dates before year 3761 in
the Hebrew calendar. (Actually, the .NET implementation of the Hebrew
calendar is even more limited - it only works with dates between years 5343 and 6000).
Ok, now this is a more reasonable scenario and seems like a much more
glaring limitation. I will ask after this one....
The implementation of DateTime and of date formatting code obviously extends what's available in Win32 or Ole - so why impose these arbitrary limits?


As I said I don't think they are arbitrary limits, but when I have not even
seen the code I cannot guess as to the reasoning and/or logic. If I would
have to guess I would hazard a speculation that perhaps the code was a port
of the oleaut code and the limitation is based on the way that the algorithm
was moved over. But I do not know for sure....
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.

Jul 21 '05 #10

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

Similar topics

7
3207
by: Jim Davis | last post by:
I'm (still) working on an ISO 8601 date parser. I want to convert at least the formats described here: http://www.w3.org/TR/NOTE-datetime Well.. I've got most of it working (via RegEx's) good enough for me but I'm having a brain block when it comes to TimeZone. The datetime may come with an optional timezone offset (from GMT) as here (the offset is +1 hour from GMT):
6
2482
by: Bijoy Naick | last post by:
I have an events table which stores the time of each event - the time and assoicated timezone. Is there a way of converting this time into GMT (with support for DST).. some sort of function which accepts a time and timezone as parameters and returns the time in GMT?
8
356
by: rick cameron | last post by:
TimeZone - the only instance you can get is one representing the local time zone DateTime - cannot represent a time before 00:00:00 1 Jan 1 CE What were they thinking? This is a serious question - can anyone come up with a good reason for these incredible design restrictions? Michael Brumm http://michaelbrumm.com has produced a fix for the first problem with his SimpleTimeZone class - good on you, Michael!
3
8341
by: asanford | last post by:
I want to create a web service that allows the caller to pass a DateTime to the web service (that is, create a web method such as void MyWebMethod(DateTime dt).) However, I want to be able to capture the TimeZone of the caller as well - but I don't want the interface to specify an xs:string as the method argument - I want it to use an xs:dateTime type argument. Now, I know when a DateTime structure is serialized into XML it becomes an...
4
6425
by: Michael Meckelein | last post by:
Hello, Wondering, if C# (framework 2.0) does not support parsing DateTime timezones in three letter acronyms. I would like to parse date strings like "2005 Nov 01 11:58:47.490 CST -6:00" but it seems C# does not support the timezone letters (CST). I suppose to use the symbol ZZZ for the timezone letters, but MSDE pointed out that it is not supported in C#, isn't it?
0
1794
by: jrhastings | last post by:
I know there are many threads on this topic but I haven't yet found an answer to this question. I'd like to map from a utc to a local time in an arbitrary timezone (not necessary the default local timezone). To do this on UNIX is relatively straightforward by setting the TZ environment variable (and calling time.tzset()). On Windows, one can get close to the answer using the pytz module (to load the timezone based on the standard UNIX...
2
11889
by: Sanjay | last post by:
Hi All, Using pytz, I am facing a problem with Asia/Calcutta, described below. Asia/Calcutta is actually IST, which is GMT + 5:30. But while using pytz, it was recognized as HMT (GMT + 5:53). While I digged into the oslan database, I see the following: # Zone NAME GMTOFF RULES FORMAT Zone Asia/Calcutta 5:53:28 - LMT 1880 # Kolkata
2
5173
by: Michele Locati | last post by:
Hi to everybody I'm working with dates and time, and I can't find the way to determine the time in a generic TimeZone. Here's an example of what I'd like to do: // I get the local date and time DataTime NowHere = DateTime.Now;
6
20330
by: jehugaleahsa | last post by:
Hello: I would like it so that the time displayed was always for CDT/CDS. Potentially, the application can be run at locations in Mountain Time or Central Time. This is what I have now: // get the UTC offset depending on day light savings double hourOffset = DateTime.Now.IsDaylightSavingTime() ? -5 : -6; DateTimeOffset offset = DateTimeOffset.UtcNow.ToOffset(TimeSpan.FromHours(hourOffset));
0
9712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10341
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,...
1
7634
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
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
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...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
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.