Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #18972
| Message-ID | <14217435.zA5glZemQV@PointedEars.de> (permalink) |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Organization | PointedEars Software (PES) |
| Date | 2013-03-22 16:30 +0100 |
| Subject | Re: how to use MakeTime()? |
| Newsgroups | comp.lang.javascript |
| References | <35b1cc53-fb63-46e9-8f4d-b9880c86fdc3@googlegroups.com> |
Jim Michaels wrote:
> I am trying to use MakeTIme(), MakeDay(), and MakeDate().
> for a time zone offset, I am using
> var tztc = MakeTime(parseInt(tza[0]), parseInt(tza[1]), 0, 0);//GMT-8 or
> UTC-8 var day = MakeDay(time.getUTCFullYear(), time.getUTCMonth() + 1,
> time.getUTCDate());
> var timeWithTZ = MakeTime(time.getUTCHours(), time.getUTCMinutes(),
> time.getUTCSeconds(), time.getUTCMilliseconds()) + tztc; var tc =
> TimeClip( MakeDate(day, timeWithTZ) ); var dt = new Date(tc);
>
> but this is causing the debugger error "MakeTime is not defined". I see
> this operator in older books.
Most books on this topic are bad, however you might have misunderstood.
MakeTime() is an *Abstract* Operator. It is the name of a *Specification
algorithm* used for computing the time value of Date instances, which in
turn is used by other date-related algorithms.
> so it's very probable (?) that the browser supports it,
No, it is entirely impossible that “the browser” (which one) supports it,
unless someone has implemented the Specification algorithm as a public
method, and either made it part of their ECMAScript implementation or loaded
it from a file.
> but if so, how? it's related to the Date object.
Read the ECMAScript Language Specification (again, more carefully this
time). The current Edition is 5.1, and MakeTime() is specified in its
subsection 15.9.1.11. The corresponding section starts with:
| 15.9.1 Overview of Date Objects and Definitions of Abstract Operators
|
| The following functions are abstract operations that operate on time
^^^^^^^^^^^^^^^^^^^
| values (defined in 15.9.1.1). Note that, in every case, if any argument to
| one of these functions is NaN, the result will be NaN.
So, what are you really up to?
And please do not post to Usenet using Google Groups. See also my
signature.
--
PointedEars
Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
how to use MakeTime()? Jim Michaels <jmichae3@yahoo.com> - 2013-03-21 18:36 -0700
Re: how to use MakeTime()? Scott Sauyet <scott.sauyet@gmail.com> - 2013-03-21 21:04 -0700
Re: how to use MakeTime()? Jim Michaels <jmichae3@yahoo.com> - 2013-03-22 00:21 -0700
Re: how to use MakeTime()? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-22 16:44 +0100
Re: how to use MakeTime()? Scott Sauyet <scott.sauyet@gmail.com> - 2013-03-22 18:58 -0700
Re: how to use MakeTime()? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-22 16:30 +0100
Re: how to use MakeTime()? Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-03-24 18:36 +0000
csiph-web