Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #24169

Re: Possible to treat time in milliseconds as a different time zone?

From Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Possible to treat time in milliseconds as a different time zone?
Date 2013-05-22 16:46 +0200
Organization A noiseless patient Spider
Message-ID <knilgn$joi$1@dont-email.me> (permalink)
References <9aa4dbef-0212-4823-9b31-1a6d54ee772c@googlegroups.com> <b03fohFaoriU1@mid.individual.net> <lvvc6bnx7h.fsf@saunalahti.fi>

Show all headers | View raw


On 22/05/2013 12:08, Jukka Lahtinen allegedly wrote:
> Nigel Wade <nmw@ion.le.ac.uk> writes:
> 
>> Timezone is an artificial concept.
>> In Java the Date object represents a particular instant in time, and is
>> the number of milliseconds since 1970. This is
> 
> "1970" is as artificial as timezone.
> The beginning of the year is just as timezone-dependent as any other
> point of time after that.

Nigel was being concise since he assumed he was talking to an informed
public. The complete formulation would have been: "the number of
milliseconds since midnight, January 1st, 1970 *UTC*". So it does indeed
represent a specific instant in time.

> The Date object represents milliseconds after beginning of year 1970 in
> a specific timezone. 

No. A Date object can represent any date as understood by humans. For
its *internal representation*, it uses the number of milliseconds since
midnight, January 1st, 1970 UTC, which it then converts to a calendar
day and timezone-specific time -- according to the settings of your
Calendar object and things like leap seconds, etc. -- for representation
purposes.

But to the API, the number of milliseconds always means the same thing.
You can change its meaning, but the API won't understand it.

-- 
DF.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Possible to treat time in milliseconds as a different time zone? laredotornado@zipmail.com - 2013-05-21 07:58 -0700
  Re: Possible to treat time in milliseconds as a different time zone? Arne Vajhøj <arne@vajhoej.dk> - 2013-05-21 11:23 -0400
  Re: Possible to treat time in milliseconds as a different time zone? Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-05-21 11:31 -0400
  Re: Possible to treat time in milliseconds as a different time zone? Stanimir Stamenkov <s7an10@netscape.net> - 2013-05-21 23:09 +0300
  Re: Possible to treat time in milliseconds as a different time zone? Nigel Wade <nmw@ion.le.ac.uk> - 2013-05-22 10:00 +0100
    Re: Possible to treat time in milliseconds as a different time zone? Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2013-05-22 13:08 +0300
      Re: Possible to treat time in milliseconds as a different time zone? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-05-22 16:46 +0200
  Re: Possible to treat time in milliseconds as a different time zone? Roedy Green <see_website@mindprod.com.invalid> - 2013-05-22 03:03 -0700
  Re: Possible to treat time in milliseconds as a different time zone? Robert Klemme <shortcutter@googlemail.com> - 2013-05-26 14:23 +0200
  Re: Possible to treat time in milliseconds as a different time zone? Michal Kleczek <michal_wytnijto@kleczek.org> - 2013-05-27 11:45 +0200

csiph-web