Hi Rick,
I'm not quite familiar with java. According to the Java Language
Specification from MSDN
(
http://msdn.microsoft.com/library/default.asp?url=/library/en-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" <
[email protected]>
| References: <#
[email protected]>
<
[email protected]>
<#
[email protected]>
<
[email protected]>
| 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: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: user.seagatesoftware.com 204.50.113.28
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:111791
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| 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
|
| | > 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.Globalization.GregorianCalendar class.
| >
| > Please refer to the following link for more information:
| >
| >
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
| > frlrfsystemglobalizationgregoriancalendarclasstopic.asp
| >
| > Kevin Yu
| > =======
| > "This posting is provided "AS IS" with no warranties, and confers no
| > rights."
| >
| > --------------------
| > | From: "rick cameron" <
[email protected]>
| > | References: <#
[email protected]>
| > <
[email protected]>
| > | 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: <#
[email protected]>
| > | Newsgroups:
| >
|
microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.clr,micr
| > osoft.public.dotnet.general
| > | NNTP-Posting-Host: d142-173-9-56.bchsia.telus.net 142.173.9.56
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.clr:8293
| > microsoft.public.dotnet.general:111703
| > microsoft.public.dotnet.framework:56069
| > | X-Tomcat-NG: microsoft.public.dotnet.general
| > |
| > | 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
| > |
| > | message | > | > 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.
| > | >
| > | >
| > | > | > | > > 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
| > | > >
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|