Re: how to make dates without timezones?
- From: Dr J R Stockton <reply0908@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 22 Feb 2009 13:14:02 +0000
In comp.lang.java.programmer message <WeYnl.17462$yr3.9988@xxxxxxxxxxxxx
sbc.com>, Sat, 21 Feb 2009 11:04:14, Mark Space
<markspace@xxxxxxxxxxxxxx> posted:
epicwinter wrote:
I have tried this too. It works in some respects but creates new
issues. There are a few areas where time is pertinent on my
application and in this manner it would always show the client the
wrong time unless they happened to actually be in the same time zone
as the server.
This implies to me that you have two different types of dates, and you
shouldn't be trying to use the same type (java.util.Date) for both.
Indeed, there are two types of date, with an overlap. Or, rather, there
are three types of date.
One type is like the date of Easter, or Christmas, or other Birthdays :
the same date everywhere on the world (Orthodox Christians etc.
disregarded). That can be called a Chronological Date, since it is what
historians use.
The other two are the sort of date which, combined with a time of day
and an offset from UTC, indicates a single absolute instant in a
location-dependent manner; for one, the offset from UTC is the local
clock offset, for the other it is zero regardless of location.
For those whose clocks are never adjusted either for Summer & Winter or
to agree with [different] neighbours, either can be used, though it's
not reasonable to use a local date for non-local purposes.
Otherwise, one should use local dates for local events, UTC dates for
events not associated with a terrestrial locality, and Chronological
dates for ordinary life where clock changes either do not occur or can
be disregarded.
A system that handles only dates can be considered as, and implemented
by, a system that handles UTC date/time with time=00:00:00. One can
also use UTC methods to handle local date/time whenever the offset can
be disregarded - but then, ignoring Jet Stream effects, flying across
the Atlantic takes eight or ten hours longer Eastbound than Westbound.
UTC methods should be faster than local methods, because there os no
offset from UTC to be determined.
If necessary, it is easy enough to write code, using just general-
purpose programming operations, to convert between Year-Month-Day and
daycount. and to do input, output, and validation; methods, albeit not
Java, are via sig.
My anchor <URL:http://www.merlyn.demon.co.uk/estr-bcp.htm#TNS>
is immediately preceded by Easter code in JavaScript,
Pascal/Delphi, and C; I'd be pleased to add a good Java
version.
--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
Web - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
.
- References:
- how to make dates without timezones?
- From: epicwinter
- Re: how to make dates without timezones?
- From: Arne Vajhøj
- Re: how to make dates without timezones?
- From: epicwinter
- Re: how to make dates without timezones?
- From: Mark Space
- how to make dates without timezones?
- Prev by Date: Re: order in if statement
- Next by Date: Re: order in if statement
- Previous by thread: Re: how to make dates without timezones?
- Next by thread: Re: how to make dates without timezones?
- Index(es):
Relevant Pages
|