0001 
0002 /*
0003  *  JScripter Standard 1.0 - To Script In Java
0004  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
0005  *  
0006  *  This program is free software: you can redistribute it and/or modify
0007  *  it under the terms of the GNU Affero General Public License as published by
0008  *  the Free Software Foundation, either version 3 of the License, or
0009  *  (at your option) any later version.
0010  *  
0011  *  This program is distributed in the hope that it will be useful,
0012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  *  GNU Affero General Public License for more details.
0015  *  
0016  *  You should have received a copy of the GNU Affero General Public License
0017  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018  */
0019 
0020 package jsx.core;
0021 
0022 import js.*;
0023 
0024 /**
0025  * <p>A utility class providing basic date operations with its static methods.</p>
0026  * <p>Users are encouraged to use the utilities provided by this class instead of the 
0027  * <b>opaque</b> methods of {@link js.DateLike} or {@link js.core.JsDate} in 
0028  * consideration of the reuse benefit for re-compilation results.</p>
0029  * 
0030  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
0031  */
0032 public final class DateLikes extends Disposable
0033 {
0034     private DateLikes() {}
0035 
0036     /**
0037      * <p>Returns the internal, millisecond representation of the current date instance.</p>
0038      * <p>It converts the current date instance to a single integer. This is useful when 
0039      * you want to compare two date instances or to determine the time elapsed between two 
0040      * dates. Note that the millisecond representation of a date is independent of the 
0041      * time zone, so there is no <tt>getUTCTime()</tt> method in addition to this one. 
0042      * Don't confuse this method with the {@link #getDay(js.DateLike)} and {@link #getDate(js.DateLike)} methods, 
0043      * which return the day of the week and the day of the month, respectively</p>
0044      * <p>{@link js.core.JsGlobal.Date#parse(Object)} and {@link js.core.JsGlobal.Date#UTC(Object, Object)} 
0045      * allow you to convert a date and time specification to a millisecond representation without 
0046      * going through the overhead of first creating a date object.</p>
0047      * @param d The current date instance.
0048      * @return The millisecond representation of the current date instance, that is, the 
0049      * number of milliseconds between midnight (GMT) on 1/1/1970 and the date and time 
0050      * specified by the date.
0051      * @see #setTime(js.DateLike, Object)
0052      * @see js.core.JsGlobal.Date#parse(Object)
0053      * @see js.core.JsGlobal.Date#UTC(Object, Object)
0054      * @see js.core.JsGlobal.Date#UTC(Object, Object, Object)
0055      * @see js.core.JsGlobal.Date#UTC(Object, Object, Object, Object)
0056      * @see js.core.JsGlobal.Date#UTC(Object, Object, Object, Object, Object)
0057      * @see js.core.JsGlobal.Date#UTC(Object, Object, Object, Object, Object, Object)
0058      * @see js.core.JsGlobal.Date#UTC(Object, Object, Object, Object, Object, Object, Object)
0059      * @see js.DateLike#getTime()
0060      * @since 1.0
0061      */
0062     public static final Number getTime(DateLike d) {
0063         return d.getTime();
0064     }
0065     /**
0066      * <p>Returns the year of the current date instance in full four-digit form, in local 
0067      * time.</p>
0068      * @param d The current date instance.
0069      * @return The year that results when the current date instance is expressed in local 
0070      * time. The return value is a full four-digit year, including the century, not a 
0071      * two-digit abbreviation..
0072      * @see #getUTCFullYear(js.DateLike)
0073      * @see js.DateLike#getFullYear()
0074      * @since 1.0
0075      */
0076     public static final Number getFullYear(DateLike d) {
0077         return d.getFullYear();
0078     }
0079     /**
0080      * <p>Returns the year of the current date instance in full four-digit form, in 
0081      * universal time.</p>
0082      * @param d The current date instance.
0083      * @return The year that results when the current date instance is expressed in 
0084      * universal time. The return value is a full four-digit year, not a two-digit 
0085      * abbreviation.
0086      * @see #getFullYear(js.DateLike)
0087      * @see js.DateLike#getUTCFullYear()
0088      * @since 1.0
0089      */
0090     public static final Number getUTCFullYear(DateLike d) {
0091         return d.getUTCFullYear();
0092     }
0093     /**
0094      * <p>Returns the month field of the current date instance, in local time.</p>
0095      * @param d The current date instance.
0096      * @return The month of the year that results when the current date instance is 
0097      * expressed in local time. The return value is an integer between 0 (January) 
0098      * and 11 (December). Note that the date represents the first day of the month as 1 
0099      * but represents the first month of the year as 0.
0100      * @see #getUTCMonth(js.DateLike)
0101      * @see js.DateLike#getMonth()
0102      * @since 1.0
0103      */
0104     public static final Number getMonth(DateLike d) {
0105         return d.getMonth();
0106     }
0107     /**
0108      * <p>Returns the month field of the current date instance, in universal time.</p>
0109      * @param d The current date instance.
0110      * @return The month of the year that results when the current date instance is 
0111      * expressed in universal time. The return value is an integer between 0 (January) 
0112      * and 11 (December). Note that the date represents the first day of the month as 1 
0113      * but represents the first month of the year as 0.
0114      * @see #getMonth(js.DateLike)
0115      * @see js.DateLike#getUTCMonth()
0116      * @since 1.0
0117      */
0118     public static final Number getUTCMonth(DateLike d) {
0119         return d.getUTCMonth();
0120     }
0121     /**
0122      * <p>Returns the day of the month of the current date instance, in local time.</p>
0123      * @param d The current date instance.
0124      * @return The day of the month of the current date instance, using local time. 
0125      * Return values are between 1 and 31.
0126      * @see #getUTCDate(js.DateLike)
0127      * @see js.DateLike#getDate()
0128      * @since 1.0
0129      */
0130     public static final Number getDate(DateLike d) {
0131         return d.getDate();
0132     }
0133     /**
0134      * <p>Returns the day of the month of the current date instance, in universal time.</p>
0135      * @param d The current date instance.
0136      * @return The day of the month (a value between 1 and 31) that results when the 
0137      * current date instance is expressed in universal time.
0138      * @see #getDate(js.DateLike)
0139      * @see js.DateLike#getUTCDate()
0140      * @since 1.0
0141      */
0142     public static final Number getUTCDate(DateLike d) {
0143         return d.getUTCDate();
0144     }
0145     /**
0146      * <p>Returns the day of the week of the current date instance, in local time.</p>
0147      * @param d The current date instance.
0148      * @return The day of the week of the current date instance, using local time. Return values 
0149      * are between 0 (Sunday) and 6 (Saturday).
0150      * @see #getUTCDay(js.DateLike)
0151      * @see js.DateLike#getDay()
0152      * @since 1.0
0153      */
0154     public static final Number getDay(DateLike d) {
0155         return d.getDay();
0156     }
0157     /**
0158      * <p>Returns the day of the week of current date instance, in universal time.</p>
0159      * @param d The current date instance.
0160      * @return The day of the week that results when the current date instance is expressed 
0161      * in universal time. Return values are between 0 (Sunday) and 6 (Saturday).
0162      * @see #getDay(js.DateLike)
0163      * @see js.DateLike#getUTCDay()
0164      * @since 1.0
0165      */
0166     public static final Number getUTCDay(DateLike d) {
0167         return d.getUTCDay();
0168     }
0169     /**
0170      * <p>Returns the hours field of the current date instance, in local time.</p>
0171      * @param d The current date instance.
0172      * @return The hours field, expressed in local time, of the current date instance. 
0173      * Return values are between 0 (midnight) and 23 (11 p.m.).
0174      * @see #getUTCHours(js.DateLike)
0175      * @see js.DateLike#getHours()
0176      * @since 1.0
0177      */
0178     public static final Number getHours(DateLike d) {
0179         return d.getHours();
0180     }
0181     /**
0182      * <p>Returns the hours field of the current date instance, in universal time.</p>
0183      * @param d The current date instance.
0184      * @return The hours field, expressed in universal time, of the current date instance. 
0185      * The return value is an integer between 0 (midnight) and 23 (11 p.m.).
0186      * @see #getHours(js.DateLike)
0187      * @see js.DateLike#getUTCHours()
0188      * @since 1.0
0189      */
0190     public static final Number getUTCHours(DateLike d) {
0191         return d.getUTCHours();
0192     }
0193     /**
0194      * <p>Returns the minutes field of a Date object, in local or universal time.</p>
0195      * @param d The current date instance.
0196      * @return The minutes field, expressed in local time, of the current date instance. 
0197      * Return values are between 0 and 59.
0198      * @see #getUTCMinutes(js.DateLike)
0199      * @see js.DateLike#getMinutes()
0200      * @since 1.0
0201      */
0202     public static final Number getMinutes(DateLike d) {
0203         return d.getMinutes();
0204     }
0205     /**
0206      * <p>Returns the minutes field of the current date instance, in universal time.</p>
0207      * @param d The current date instance.
0208      * @return The minutes field, expressed in universal time, of the current date instance. 
0209      * The return value is an integer between 0 and 59.
0210      * @see #getMinutes(js.DateLike)
0211      * @see js.DateLike#getUTCMinutes()
0212      * @since 1.0
0213      */
0214     public static final Number getUTCMinutes(DateLike d) {
0215         return d.getUTCMinutes();
0216     }
0217     /**
0218      * <p>Returns the seconds field of the current date instance, in local time.</p>
0219      * @param d The current date instance.
0220      * @return The seconds field, expressed in local time, of the current date instance. 
0221      * Return values are between 0 and 59.
0222      * @see #getUTCSeconds(js.DateLike)
0223      * @see js.DateLike#getSeconds()
0224      * @since 1.0
0225      */
0226     public static final Number getSeconds(DateLike d) {
0227         return d.getSeconds();
0228     }
0229     /**
0230      * <p>Returns the seconds field of the current date instance, in universal time.</p>
0231      * @param d The current date instance.
0232      * @return The seconds field, expressed in universal time, of the current date instance. 
0233      * The return value is an integer between 0 and 59.
0234      * @see #getSeconds(js.DateLike)
0235      * @see js.DateLike#getUTCSeconds()
0236      * @since 1.0
0237      */
0238     public static final Number getUTCSeconds(DateLike d) {
0239         return d.getUTCSeconds();
0240     }
0241     /**
0242      * <p>Returns the milliseconds field of the current date instance, in local time.</p>
0243      * @param d The current date instance.
0244      * @return The milliseconds field, expressed in local time, of the current date instance.
0245      * @see #getUTCMilliseconds(js.DateLike)
0246      * @see js.DateLike#getMilliseconds()
0247      * @since 1.0
0248      */
0249     public static final Number getMilliseconds(DateLike d) {
0250         return d.getMilliseconds();
0251     }
0252     /**
0253      * <p>Returns the milliseconds field of current date instance, in universal time.</p>
0254      * @param d The current date instance.
0255      * @return The milliseconds field, expressed in universal time, of the current date instance.
0256      * @see #getMilliseconds(js.DateLike)
0257      * @see js.DateLike#getUTCMilliseconds()
0258      * @since 1.0
0259      */
0260     public static final Number getUTCMilliseconds(DateLike d) {
0261         return d.getUTCMilliseconds();
0262     }
0263     /**
0264      * <p>Returns the difference, in minutes, between the local and UTC representations of 
0265      * the current date instance. Note that the value returned depends on whether daylight 
0266      * saving time is or would be in effect at the specific date.</p>
0267      * <p>The return value is measured in minutes, rather than hours, because some 
0268      * countries have time zones that are not at even one-hour intervals.</p>
0269      * @param d The current date instance.
0270      * @return The difference, in minutes, between GMT and local time.
0271      * @see js.DateLike#getTimezoneOffset()
0272      * @since 1.0
0273      */
0274     public static final Number getTimezoneOffset(DateLike d) {
0275         return d.getTimezoneOffset();
0276     }
0277     /**
0278      * <p>Sets the fields of the current date instance using the millisecond format.</p>
0279      * @param d The current date instance.
0280      * @param time The number of milliseconds between the desired date and time and 
0281      * midnight GMT on January 1, 1970. A millisecond value of this type may also be 
0282      * passed to the {@link Js#date(Number)}, {@link js.core.JsDate#JsDate(Number)}, 
0283      * {@link js.core.JsDate#JsDate(NumberLike)}, {@link js.core.JsDate#JsDate(String)}, 
0284      * {@link js.core.JsDate#JsDate(StringLike)}, {@link js.core.JsGlobal.Date#create(Number)} 
0285      * or {@link js.core.JsGlobal.Date#create(Number)} and may be obtained by calling the 
0286      * {@link js.core.JsGlobal.Date#UTC(Object, Object)} and {@link js.core.JsGlobal.Date#parse(Object)} 
0287      * methods. Representing a date in this millisecond format makes it independent of 
0288      * time zone.
0289      * @return The <tt>time</tt> argument. Prior to ECMAScript standardization, 
0290      * this method returns nothing.
0291      * @see js.DateLike#setTime(Object)
0292      * @since 1.0
0293      */
0294     public static final Number setTime(DateLike d, Object time) {
0295         return d.setTime(time);
0296     }
0297     /**
0298      * <p>Sets the milliseconds field of a date, using local time.</p>
0299      * @param d The current date instance.
0300      * @param ms The milliseconds field, expressed in local time, to be set in the current 
0301      * date instance. This argument should be an integer between 0 and 999.
0302      * @return The millisecond representation of the adjusted date.
0303      * @see #setUTCMilliseconds(js.DateLike, Object)
0304      * @see js.DateLike#setMilliseconds(Object)
0305      * @since 1.0
0306      */
0307     public static final Number setMilliseconds(DateLike d, Object ms) {
0308         return d.setMilliseconds(ms);
0309     }
0310     /**
0311      * <p>Sets the milliseconds field of the current date instance, using universal time.</p>
0312      * @param d The current date instance.
0313      * @param ms The milliseconds field, expressed in universal time, to be set in the 
0314      * current date instance. This argument should be an integer between 0 and 999.
0315      * @return The millisecond representation of the adjusted date.
0316      * @see #setMilliseconds(js.DateLike, Object)
0317      * @see js.DateLike#setUTCMilliseconds(Object)
0318      * @since 1.0
0319      */
0320     public static final Number setUTCMilliseconds(DateLike d, Object ms) {
0321         return d.setUTCMilliseconds(ms);
0322     }
0323     /**
0324      * <p>Sets the seconds field of the current date instance, using local time.</p>
0325      * @param d The current date instance.
0326      * @param sec An integer between 0 and 59 that is set as the seconds value for the 
0327      * current date instance.
0328      * @return The millisecond representation of the adjusted date. Prior to ECMAScript 
0329      * standardization, this method returns nothing.
0330      * @see #setUTCSeconds(js.DateLike, Object)
0331      * @see #setSeconds(js.DateLike, Object, Object)
0332      * @see js.DateLike#setSeconds(Object)
0333      * @since 1.0
0334      */
0335     public static final Number setSeconds(DateLike d, Object sec) {
0336         return d.setSeconds(sec);
0337     }
0338     /**
0339      * <p>Sets the seconds field of the current date instance, using universal time.</p>
0340      * @param d The current date instance.
0341      * @param sec The seconds field, expressed in universal time, to be set in the current 
0342      * date instance. This argument should be an integer between 0 and 59.
0343      * @return The millisecond representation of the adjusted date.
0344      * @see #setSeconds(js.DateLike, Object)
0345      * @see #setUTCSeconds(js.DateLike, Object, Object)
0346      * @see js.DateLike#setUTCSeconds(Object)
0347      * @since 1.0
0348      */
0349     public static final Number setUTCSeconds(DateLike d, Object sec) {
0350         return d.setUTCSeconds(sec);
0351     }
0352     /**
0353      * <p>Sets the seconds field and optionally the milliseconds field of the current date 
0354      * instance, using local .</p>
0355      * @param d The current date instance.
0356      * @param sec An integer between 0 and 59 that is set as the seconds value for the 
0357      * current date instance.
0358      * @param ms An optional integer, between 0 and 999, that is used as the new value 
0359      * in local time of the milliseconds field of the current date instance. This argument 
0360      * is not supported prior to ECMAScript standardization.
0361      * @return The millisecond representation of the adjusted date. Prior to ECMAScript 
0362      * standardization, this method returns nothing.
0363      * @see #setUTCSeconds(js.DateLike, Object, Object)
0364      * @see #setSeconds(js.DateLike, Object)
0365      * @see js.DateLike#setSeconds(Object, Object)
0366      * @since 1.0
0367      */
0368     public static final Number setSeconds(DateLike d, Object sec, Object ms) {
0369         return d.setSeconds(sec, ms);
0370     }
0371     /**
0372      * <p>Sets the seconds field and optionally the milliseconds field of the current date 
0373      * instance, using universal time.</p>
0374      * @param d The current date instance.
0375      * @param sec The seconds field, expressed in universal time, to be set in the current 
0376      * date instance. This argument should be an integer between 0 and 59.
0377      * @param ms An optional integer, between 0 and 999, that is used as the new value 
0378      * in universal time of the milliseconds field of the current date instance.
0379      * @return The millisecond representation of the adjusted date.
0380      * @see #setSeconds(js.DateLike, Object, Object)
0381      * @see #setUTCSeconds(js.DateLike, Object)
0382      * @see js.DateLike#setUTCSeconds(Object, Object)
0383      * @since 1.0
0384      */
0385     public static final Number setUTCSeconds(DateLike d, Object sec, Object ms) {
0386         return d.setUTCSeconds(sec, ms);
0387     }
0388     /**
0389      * <p>Sets the minutes field of the current date instance, using local time.</p>
0390      * @param d The current date instance.
0391      * @param min An optional integer, between 0 and 59, that is used as the new value 
0392      * in local time of the minutes field of the current date instance.
0393      * @return The millisecond representation of the adjusted date. 
0394      * Prior to ECMAScript standardization, this method returns nothing.
0395      * @see #setUTCMinutes(js.DateLike, Object)
0396      * @see #setMinutes(js.DateLike, Object, Object)
0397      * @see #setMinutes(js.DateLike, Object, Object, Object)
0398      * @see js.DateLike#setMinutes(Object)
0399      * @since 1.0
0400      */
0401     public static final Number setMinutes(DateLike d, Object min) {
0402         return d.setMinutes(min);
0403     }
0404     /**
0405      * <p>Sets the minutes field of the current date instance, using universal time.</p>
0406      * @param d The current date instance.
0407      * @param min An optional integer, between 0 and 59, that is used as the new value 
0408      * in universal time of the minutes field of the current date instance.
0409      * @return The millisecond representation of the adjusted date. 
0410      * Prior to ECMAScript standardization, this method returns nothing.
0411      * @see #setMinutes(js.DateLike, Object)
0412      * @see #setUTCMinutes(js.DateLike, Object, Object)
0413      * @see #setUTCMinutes(js.DateLike, Object, Object, Object)
0414      * @see js.DateLike#setUTCMinutes(Object)
0415      * @since 1.0
0416      */
0417     public static final Number setUTCMinutes(DateLike d, Object min) {
0418         return d.setUTCMinutes(min);
0419     }
0420     /**
0421      * <p>Sets the minutes field and optionally the seconds field of the current date 
0422      * instance, using local time.</p>
0423      * @param d The current date instance.
0424      * @param min An optional integer, between 0 and 59, that is used as the new value 
0425      * in local time of the minutes field of the current date instance. This argument is 
0426      * not supported prior to ECMAScript standardization.
0427      * @param sec An optional integer, between 0 and 59, that is used as the new value 
0428      * in local time of the seconds field of the current date instance. This argument is 
0429      * not supported prior to ECMAScript standardization.
0430      * @return The millisecond representation of the adjusted date. 
0431      * Prior to ECMAScript standardization, this method returns nothing.
0432      * @see #setUTCMinutes(js.DateLike, Object, Object)
0433      * @see #setMinutes(js.DateLike, Object)
0434      * @see #setMinutes(js.DateLike, Object, Object, Object)
0435      * @see js.DateLike#setMinutes(Object, Object)
0436      * @since 1.0
0437      */
0438     public static final Number setMinutes(DateLike d, Object min, Object sec) {
0439         return d.setMinutes(min, sec);
0440     }
0441     /**
0442      * <p>Sets the minutes field and optionally the seconds field of the current date 
0443      * instance, using universal time.</p>
0444      * @param d The current date instance.
0445      * @param min An optional integer, between 0 and 59, that is used as the new value 
0446      * in universal time of the minutes field of the current date instance.
0447      * @param sec An optional integer, between 0 and 59, that is used as the new value 
0448      * in universal time of the seconds field of the current date instance.
0449      * @return The millisecond representation of the adjusted date. 
0450      * Prior to ECMAScript standardization, this method returns nothing.
0451      * @see #setMinutes(js.DateLike, Object, Object)
0452      * @see #setUTCMinutes(js.DateLike, Object)
0453      * @see #setUTCMinutes(js.DateLike, Object, Object, Object)
0454      * @see js.DateLike#setUTCMinutes(Object, Object)
0455      * @since 1.0
0456      */
0457     public static final Number setUTCMinutes(DateLike d, Object min, Object sec) {
0458         return d.setUTCMinutes(min, sec);
0459     }
0460     /**
0461      * <p>Sets the minutes field and optionally the seconds and milliseconds fields of the 
0462      * current date instance, using local time.</p>
0463      * @param d The current date instance.
0464      * @param min An optional integer, between 0 and 59, that is used as the new value 
0465      * in local time of the minutes field of the current date instance. This argument is 
0466      * not supported prior to ECMAScript standardization.
0467      * @param sec An optional integer, between 0 and 59, that is used as the new value 
0468      * in local time of the seconds field of the current date instance. This argument is 
0469      * not supported prior to ECMAScript standardization.
0470      * @param ms An optional integer, between 0 and 999, that is used as the new value 
0471      * in local time of the milliseconds field of the current date instance. This argument 
0472      * is not supported prior to ECMAScript standardization.
0473      * @return The millisecond representation of the adjusted date. 
0474      * Prior to ECMAScript standardization, this method returns nothing.
0475      * @see #setUTCMinutes(js.DateLike, Object, Object, Object)
0476      * @see #setMinutes(js.DateLike, Object)
0477      * @see #setMinutes(js.DateLike, Object, Object)
0478      * @see js.DateLike#setMinutes(Object, Object, Object)
0479      * @since 1.0
0480      */
0481     public static final Number setMinutes(DateLike d, Object min, Object sec, Object ms) {
0482         return d.setMinutes(min, sec, ms);
0483     }
0484     /**
0485      * <p>Sets the minutes field and optionally the seconds and milliseconds fields of the 
0486      * current date instance, using universal time.</p>
0487      * @param d The current date instance.
0488      * @param min An optional integer, between 0 and 59, that is used as the new value 
0489      * in universal time of the minutes field of the current date instance.
0490      * @param sec An optional integer, between 0 and 59, that is used as the new value 
0491      * in universal time of the seconds field of the current date instance.
0492      * @param ms An optional integer, between 0 and 999, that is used as the new value 
0493      * in universal time of the milliseconds field of the current date instance.
0494      * @return The millisecond representation of the adjusted date. 
0495      * Prior to ECMAScript standardization, this method returns nothing.
0496      * @see #setMinutes(js.DateLike, Object, Object, Object)
0497      * @see #setUTCMinutes(js.DateLike, Object)
0498      * @see #setUTCMinutes(js.DateLike, Object, Object)
0499      * @see js.DateLike#setUTCMinutes(Object, Object, Object)
0500      * @since 1.0
0501      */
0502     public static final Number setUTCMinutes(DateLike d, Object min, Object sec, Object ms) {
0503         return d.setUTCMinutes(min, sec, ms);
0504     }
0505     /**
0506      * <p>Sets the hour field of the current date instance, using local time.</p>
0507      * @param d The current date instance.
0508      * @param hr An integer between 0 (midnight) and 23 (11 p.m.) local time that is set 
0509      * as the new hours value of the current date instance.
0510      * @return The millisecond representation of the adjusted date. 
0511      * Prior to ECMAScript standardization, this method returns nothing.
0512      * @see #setUTCHours(js.DateLike, Object)
0513      * @see #setHours(js.DateLike, Object, Object)
0514      * @see #setHours(js.DateLike, Object, Object, Object)
0515      * @see #setHours(js.DateLike, Object, Object, Object, Object)
0516      * @see js.DateLike#setHours(Object)
0517      * @since 1.0
0518      */
0519     public static final Number setHours(DateLike d, Object hr) {
0520         return d.setHours(hr);
0521     }
0522     /**
0523      * <p>Sets the hour field of the current date instance, using universal time.</p>
0524      * @param d The current date instance.
0525      * @param hr The hours field, expressed in universal time, to be set in the current 
0526      * date instance. This argument should be an integer between 0 (midnight) and 23 
0527      * (11 p.m.).
0528      * @return The millisecond representation of the adjusted date. 
0529      * @see #setHours(js.DateLike, Object)
0530      * @see #setUTCHours(js.DateLike, Object, Object)
0531      * @see #setUTCHours(js.DateLike, Object, Object, Object)
0532      * @see #setUTCHours(js.DateLike, Object, Object, Object, Object)
0533      * @see js.DateLike#setUTCHours(Object)
0534      * @since 1.0
0535      */
0536     public static final Number setUTCHours(DateLike d, Object hr) {
0537         return d.setUTCHours(hr);
0538     }
0539     /**
0540      * <p>Sets the hour field and optionally the minutes field of the current date 
0541      * instance, using local time.</p>
0542      * @param d The current date instance.
0543      * @param hr An integer between 0 (midnight) and 23 (11 p.m.) local time that is set 
0544      * as the new hours value of the current date instance.
0545      * @param min An optional integer, between 0 and 59, that is used as the new value 
0546      * in local time of the minutes field of the current date instance. This argument is 
0547      * not supported prior to ECMAScript standardization.
0548      * @return The millisecond representation of the adjusted date. 
0549      * Prior to ECMAScript standardization, this method returns nothing.
0550      * @see #setUTCHours(js.DateLike, Object, Object)
0551      * @see #setHours(js.DateLike, Object)
0552      * @see #setHours(js.DateLike, Object, Object, Object)
0553      * @see #setHours(js.DateLike, Object, Object, Object, Object)
0554      * @see js.DateLike#setHours(Object, Object)
0555      * @since 1.0
0556      */
0557     public static final Number setHours(DateLike d, Object hr, Object min) {
0558         return d.setHours(hr, min);
0559     }
0560     /**
0561      * <p>Sets the hour field and optionally the minutes field of the current date 
0562      * instance, using universal time.</p>
0563      * @param d The current date instance.
0564      * @param hr The hours field, expressed in universal time, to be set in the current 
0565      * date instance. This argument should be an integer between 0 (midnight) and 23 
0566      * (11 p.m.).
0567      * @param min An optional integer, between 0 and 59, that is used as the new value 
0568      * in universal time of the minutes field of the current date instance.
0569      * @return The millisecond representation of the adjusted date. 
0570      * @see #setHours(js.DateLike, Object, Object)
0571      * @see #setUTCHours(js.DateLike, Object)
0572      * @see #setUTCHours(js.DateLike, Object, Object, Object)
0573      * @see #setUTCHours(js.DateLike, Object, Object, Object, Object)
0574      * @see js.DateLike#setUTCHours(Object, Object)
0575      * @since 1.0
0576      */
0577     public static final Number setUTCHours(DateLike d, Object hr, Object min) {
0578         return d.setUTCHours(hr, min);
0579     }
0580     /**
0581      * <p>Sets the hour field and optionally the minutes and seconds fields of the current 
0582      * date instance, using local time.</p>
0583      * @param d The current date instance.
0584      * @param hr An integer between 0 (midnight) and 23 (11 p.m.) local time that is set 
0585      * as the new hours value of the current date instance.
0586      * @param min An optional integer, between 0 and 59, that is used as the new value 
0587      * in local time of the minutes field of the current date instance. This argument is 
0588      * not supported prior to ECMAScript standardization.
0589      * @param sec An optional integer, between 0 and 59, that is used as the new value 
0590      * in local time of the seconds field of the current date instance. This argument is 
0591      * not supported prior to ECMAScript standardization.
0592      * @return The millisecond representation of the adjusted date. 
0593      * Prior to ECMAScript standardization, this method returns nothing.
0594      * @see #setUTCHours(js.DateLike, Object, Object, Object)
0595      * @see #setHours(js.DateLike, Object)
0596      * @see #setHours(js.DateLike, Object, Object)
0597      * @see #setHours(js.DateLike, Object, Object, Object, Object)
0598      * @see js.DateLike#setHours(Object, Object, Object)
0599      * @since 1.0
0600      */
0601     public static final Number setHours(DateLike d, Object hr, Object min, Object sec) {
0602         return d.setHours(hr, min, sec);
0603     }
0604     /**
0605      * <p>Sets the hour field and optionally the minutes and seconds fields of the current 
0606      * date instance, using universal time.</p>
0607      * @param d The current date instance.
0608      * @param hr The hours field, expressed in universal time, to be set in the current 
0609      * date instance. This argument should be an integer between 0 (midnight) and 23 
0610      * (11 p.m.).
0611      * @param min An optional integer, between 0 and 59, that is used as the new value 
0612      * in universal time of the minutes field of the current date instance.
0613      * @param sec An optional integer, between 0 and 59, that is used as the new value 
0614      * in universal time of the seconds field of the current date instance.
0615      * @return The millisecond representation of the adjusted date.
0616      * @see #setHours(js.DateLike, Object, Object, Object)
0617      * @see #setUTCHours(js.DateLike, Object)
0618      * @see #setUTCHours(js.DateLike, Object, Object)
0619      * @see #setUTCHours(js.DateLike, Object, Object, Object, Object)
0620      * @see js.DateLike#setUTCHours(Object, Object, Object)
0621      * @since 1.0
0622      */
0623     public static final Number setUTCHours(DateLike d, Object hr, Object min, Object sec) {
0624         return d.setUTCHours(hr, min, sec);
0625     }
0626     /**
0627      * <p>Sets the hour field and optionally the minutes, seconds, and milliseconds fields 
0628      * of the current date instance, using local time.</p>
0629      * @param d The current date instance.
0630      * @param hr An integer between 0 (midnight) and 23 (11 p.m.) local time that is set 
0631      * as the new hours value of the current date instance.
0632      * @param min An optional integer, between 0 and 59, that is used as the new value 
0633      * in local time of the minutes field of the current date instance. This argument is 
0634      * not supported prior to ECMAScript standardization.
0635      * @param sec An optional integer, between 0 and 59, that is used as the new value 
0636      * in local time of the seconds field of the current date instance. This argument is 
0637      * not supported prior to ECMAScript standardization.
0638      * @param ms An optional integer, between 0 and 999, that is used as the new value 
0639      * in local time of the milliseconds field of the current date instance. This argument 
0640      * is not supported prior to ECMAScript standardization.
0641      * @return The millisecond representation of the adjusted date. 
0642      * Prior to ECMAScript standardization, this method returns nothing.
0643      * @see #setUTCHours(js.DateLike, Object, Object, Object, Object)
0644      * @see #setHours(js.DateLike, Object)
0645      * @see #setHours(js.DateLike, Object, Object)
0646      * @see #setHours(js.DateLike, Object, Object, Object)
0647      * @see js.DateLike#setHours(Object, Object, Object, Object)
0648      * @since 1.0
0649      */
0650     public static final Number setHours(DateLike d, Object hr, Object min, Object sec, Object ms) {
0651         return d.setHours(hr, min, sec, ms);
0652     }
0653     /**
0654      * <p>Sets the hour field and optionally the minutes, seconds, and milliseconds fields 
0655      * of the current date instance, using universal time.</p>
0656      * @param d The current date instance.
0657      * @param hr The hours field, expressed in universal time, to be set in the current 
0658      * date instance. This argument should be an integer between 0 (midnight) and 23 
0659      * (11 p.m.).
0660      * @param min An optional integer, between 0 and 59, that is used as the new value 
0661      * in universal time of the minutes field of the current date instance.
0662      * @param sec An optional integer, between 0 and 59, that is used as the new value 
0663      * in universal time of the seconds field of the current date instance.
0664      * @param ms An optional integer, between 0 and 999, that is used as the new value 
0665      * in universal time of the milliseconds field of the current date instance.
0666      * @return The millisecond representation of the adjusted date.
0667      * @see #setHours(js.DateLike, Object, Object, Object, Object)
0668      * @see #setUTCHours(js.DateLike, Object)
0669      * @see #setUTCHours(js.DateLike, Object, Object)
0670      * @see #setUTCHours(js.DateLike, Object, Object, Object)
0671      * @see js.DateLike#setUTCHours(Object, Object, Object, Object)
0672      * @since 1.0
0673      */
0674     public static final Number setUTCHours(DateLike d, Object hr, Object min, Object sec, Object ms) {
0675         return d.setUTCHours(hr, min, sec, ms);
0676     }
0677     /**
0678      * <p>Sets the day of the month field of the current date instance, using local time.</p>
0679      * @param d The current date instance.
0680      * @param day An integer between 1 and 31 that is used as the new value in local time 
0681      * of the day-of-the-month field of the current date instance.
0682      * @return The millisecond representation of the adjusted date. 
0683      * Prior to ECMAScript standardization, this method returns nothing.
0684      * @see #setUTCDate(js.DateLike, Object)
0685      * @see js.DateLike#setDate(Object)
0686      * @since 1.0
0687      */
0688     public static final Number setDate(DateLike d, Object day) {
0689         return d.setDate(day);
0690     }
0691     /**
0692      * <p>Sets the day of the month field of the current date instance, using universal 
0693      * time.</p>
0694      * @param d The current date instance.
0695      * @param day The day of the month, expressed in universal time, to be set in the 
0696      * current date instance. This argument should be an integer between 1 and 31.
0697      * @return The millisecond representation of the adjusted date. 
0698      * @see #setDate(js.DateLike, Object)
0699      * @see js.DateLike#setUTCDate(Object)
0700      * @since 1.0
0701      */
0702     public static final Number setUTCDate(DateLike d, Object day) {
0703         return d.setUTCDate(day);
0704     }
0705     /**
0706      * <p>Sets the month field of the current date instance, using local time.</p>
0707      * @param d The current date instance.
0708      * @param mo An integer between 0 ( January) and 11 (December) that is set as the month 
0709      * value in local time for the current date instance. Note that months are numbered 
0710      * beginning with 0, while days within the month are numbered beginning with 1.
0711      * @return The millisecond representation of the adjusted date. 
0712      * Prior to ECMAScript standardization, this method returns nothing.
0713      * @see #setUTCMonth(js.DateLike, Object)
0714      * @see #setMonth(js.DateLike, Object, Object)
0715      * @see js.DateLike#setMonth(Object)
0716      * @since 1.0
0717      */
0718     public static final Number setMonth(DateLike d, Object mo) {
0719         return d.setMonth(mo);
0720     }
0721     /**
0722      * <p>Sets the month field of the current date instance, using universal time.</p>
0723      * @param d The current date instance.
0724      * @param mo The month, expressed in universal time, to be set in the current date
0725      * instance. This argument should be an integer between 0 (January) and 11 (December). 
0726      * Note that months are numbered beginning with 0, while days within the month are 
0727      * numbered beginning with 1.
0728      * @return The millisecond representation of the adjusted date. 
0729      * @see #setMonth(js.DateLike, Object)
0730      * @see #setUTCMonth(js.DateLike, Object, Object)
0731      * @see js.DateLike#setUTCMonth(Object)
0732      * @since 1.0
0733      */
0734     public static final Number setUTCMonth(DateLike d, Object mo) {
0735         return d.setUTCMonth(mo);
0736     }
0737     /**
0738      * <p>Sets the month field and optionally the day of the month of the current date 
0739      * instance, using local time.</p>
0740      * @param d The current date instance.
0741      * @param mo An integer between 0 ( January) and 11 (December) that is set as the month 
0742      * value in local time for the current date instance. Note that months are numbered 
0743      * beginning with 0, while days within the month are numbered beginning with 1.
0744      * @param day An optional integer between 1 and 31 that is used as the new value in 
0745      * local time of the day-of-the-month field of the current date instance. This argument 
0746      * is not supported prior to ECMAScript standardization.
0747      * @return The millisecond representation of the adjusted date. 
0748      * Prior to ECMAScript standardization, this method returns nothing.
0749      * @see #setUTCMonth(js.DateLike, Object, Object)
0750      * @see #setMonth(js.DateLike, Object)
0751      * @see js.DateLike#setMonth(Object, Object)
0752      * @since 1.0
0753      */
0754     public static final Number setMonth(DateLike d, Object mo, Object day) {
0755         return d.setMonth(mo, day);
0756     }
0757     /**
0758      * <p>Sets the month field and optionally the day of the month of the current date 
0759      * instance, using universal time.</p>
0760      * @param d The current date instance.
0761      * @param mo The month, expressed in universal time, to be set in the current date
0762      * instance. This argument should be an integer between 0 (January) and 11 (December). 
0763      * Note that months are numbered beginning with 0, while days within the month are 
0764      * numbered beginning with 1.
0765      * @param day An optional integer between 1 and 31 that is used as the new value in 
0766      * universal time of the day-of-the-month field of the current date instance.
0767      * @return The millisecond representation of the adjusted date. 
0768      * @see #setMonth(js.DateLike, Object, Object)
0769      * @see #setUTCMonth(js.DateLike, Object)
0770      * @see js.DateLike#setUTCMonth(Object, Object)
0771      * @since 1.0
0772      */
0773     public static final Number setUTCMonth(DateLike d, Object mo, Object day) {
0774         return d.setUTCMonth(mo, day);
0775     }
0776     /**
0777      * <p>Sets the year field of the current date instance, using local time.</p>
0778      * @param d The current date instance.
0779      * @param yr The year, expressed in local time, to be set in the current date instance. 
0780      * This argument should be an integer that includes the century, such as 1999; it 
0781      * should not be an abbreviation, such as 99.
0782      * @return The millisecond representation of the adjusted date. 
0783      * @see #setUTCFullYear(js.DateLike, Object)
0784      * @see #setFullYear(js.DateLike, Object, Object)
0785      * @see #setFullYear(js.DateLike, Object, Object, Object)
0786      * @see js.DateLike#setFullYear(Object)
0787      * @since 1.0
0788      */
0789     public static final Number setFullYear(DateLike d, Object yr) {
0790         return d.setFullYear(yr);
0791     }
0792     /**
0793      * <p>Sets the year field of the current date instance, using universal time.</p>
0794      * @param d The current date instance.
0795      * @param yr The year, expressed in universal time, to be set in the current date 
0796      * instance. This argument should be an integer that includes the century, such as 
0797      * 1999, not an abbreviation, such as 99.
0798      * @return The millisecond representation of the adjusted date. 
0799      * @see #setFullYear(js.DateLike, Object)
0800      * @see #setUTCFullYear(js.DateLike, Object, Object)
0801      * @see #setUTCFullYear(js.DateLike, Object, Object, Object)
0802      * @see js.DateLike#setUTCFullYear(Object)
0803      * @since 1.0
0804      */
0805     public static final Number setUTCFullYear(DateLike d, Object yr) {
0806         return d.setUTCFullYear(yr);
0807     }
0808     /**
0809      * <p>Sets the year and optionally month fields of the current date instance, using 
0810      * local time.</p>
0811      * @param d The current date instance.
0812      * @param yr The year, expressed in local time, to be set in the current date instance. 
0813      * This argument should be an integer that includes the century, such as 1999; it 
0814      * should not be an abbreviation, such as 99.
0815      * @param mo An optional integer between 0 and 11 that is used as the new value in 
0816      * local time of the month field of the current date instance.
0817      * @return The millisecond representation of the adjusted date. 
0818      * @see #setUTCFullYear(js.DateLike, Object, Object)
0819      * @see #setFullYear(js.DateLike, Object)
0820      * @see #setFullYear(js.DateLike, Object, Object, Object)
0821      * @see js.DateLike#setFullYear(Object, Object)
0822      * @since 1.0
0823      */
0824     public static final Number setFullYear(DateLike d, Object yr, Object mo) {
0825         return d.setFullYear(yr, mo);
0826     }
0827     /**
0828      * <p>Sets the year and optionally month fields of the current date instance, using 
0829      * universal time.</p>
0830      * @param d The current date instance.
0831      * @param yr The year, expressed in universal time, to be set in the current date 
0832      * instance. This argument should be an integer that includes the century, such as 
0833      * 1999, not an abbreviation, such as 99.
0834      * @param mo An optional integer between 0 and 11 that is used as the new value in 
0835      * universal time of the month field of the current date instance. Note that months 
0836      * are numbered beginning with 0, while days within the month are numbered beginning 
0837      * with 1.
0838      * @return The millisecond representation of the adjusted date. 
0839      * @see #setFullYear(js.DateLike, Object, Object)
0840      * @see #setUTCFullYear(js.DateLike, Object)
0841      * @see #setUTCFullYear(js.DateLike, Object, Object, Object)
0842      * @see js.DateLike#setUTCFullYear(Object, Object)
0843      * @since 1.0
0844      */
0845     public static final Number setUTCFullYear(DateLike d, Object yr, Object mo) {
0846         return d.setUTCFullYear(yr, mo);
0847     }
0848     /**
0849      * <p>Sets the year and optionally month and day fields of the current date instance, 
0850      * using local time.</p>
0851      * @param d The current date instance.
0852      * @param yr The year, expressed in local time, to be set in the current date instance. 
0853      * This argument should be an integer that includes the century, such as 1999; it 
0854      * should not be an abbreviation, such as 99.
0855      * @param mo An optional integer between 0 and 11 that is used as the new value in 
0856      * local time of the month field of the current date instance.
0857      * @param day An optional integer between 1 and 31 that is used as the new value in 
0858      * local time of the day-of-the-month field of the current date instance.
0859      * @return The millisecond representation of the adjusted date. 
0860      * @see #setUTCFullYear(js.DateLike, Object, Object, Object)
0861      * @see #setFullYear(js.DateLike, Object)
0862      * @see #setFullYear(js.DateLike, Object, Object)
0863      * @see js.DateLike#setFullYear(Object, Object, Object)
0864      * @since 1.0
0865      */
0866     public static final Number setFullYear(DateLike d, Object yr, Object mo, Object day) {
0867         return d.setFullYear(yr, mo, day);
0868     }
0869     /**
0870      * <p>Sets the year and optionally month and day fields of the current date instance, 
0871      * using universal time.</p>
0872      * @param d The current date instance.
0873      * @param yr The year, expressed in universal time, to be set in the current date 
0874      * instance. This argument should be an integer that includes the century, such as 
0875      * 1999, not an abbreviation, such as 99.
0876      * @param mo An optional integer between 0 and 11 that is used as the new value in 
0877      * universal time of the month field of the current date instance. Note that months 
0878      * are numbered beginning with 0, while days within the month are numbered beginning 
0879      * with 1.
0880      * @param day An optional integer between 1 and 31 that is used as the new value in 
0881      * universal time of the day-of-the-month field of the current date instance.
0882      * @return The millisecond representation of the adjusted date. 
0883      * @see #setFullYear(js.DateLike, Object, Object, Object)
0884      * @see #setUTCFullYear(js.DateLike, Object)
0885      * @see #setUTCFullYear(js.DateLike, Object, Object)
0886      * @see js.DateLike#setUTCFullYear(Object, Object, Object)
0887      * @since 1.0
0888      */
0889     public static final Number setUTCFullYear(DateLike d, Object yr, Object mo, Object day) {
0890         return d.setUTCFullYear(yr, mo, day);
0891     }
0892     /**
0893      * <p>Converts a date to a string, using the local time zone and the local date 
0894      * formatting conventions.</p>
0895      * <p>This method also uses local conventions for date and time formatting, so the 
0896      * format may vary from platform to platform and from country to country. It returns 
0897      * a string formatted in what is likely the user's preferred date and time format.</p>
0898      * @param d The current date instance.
0899      * @return A string representation of the date and time specified by the current date 
0900      * instance. The date and time are represented in the local time zone and formatted 
0901      * using locally appropriate conventions.
0902      * @see #toLocaleDateString(js.DateLike)
0903      * @see #toLocaleTimeString(js.DateLike)
0904      * @see #toString(js.DateLike)
0905      * @see #toUTCString(js.DateLike)
0906      * @see js.DateLike#toLocaleString()
0907      * @since 1.0
0908      */
0909     public static final String toLocaleString(DateLike d) {
0910         return d.toLocaleString();
0911     }
0912     /**
0913      * <p>Returns a string that represents the date portion of the current date instance, 
0914      * expressed in the local time zone.</p>
0915      * @param d The current date instance.
0916      * @return An implementation-dependent, human-readable string representation of the 
0917      * date portion of the current date instance, expressed in the local time zone.
0918      * @see #toLocaleDateString(js.DateLike)
0919      * @see #toLocaleString(js.DateLike)
0920      * @see #toLocaleTimeString(js.DateLike)
0921      * @see #toString(js.DateLike)
0922      * @see #toTimeString(js.DateLike)
0923      * @see js.DateLike#toDateString()
0924      * @since 1.0
0925      */
0926     public static final String toDateString(DateLike d) {
0927         return d.toDateString();
0928     }
0929     /**
0930      * <p>Returns a string that represents the time portion of the current date instance, 
0931      * expressed in the local time zone.</p>
0932      * @param d The current date instance.
0933      * @return An implementation-dependent, human-readable string representation of the 
0934      * time portion of the current date instance, expressed in the local time zone.
0935      * @see #toDateString(js.DateLike)
0936      * @see #toLocaleDateString(js.DateLike)
0937      * @see #toLocaleString(js.DateLike)
0938      * @see #toLocaleTimeString(js.DateLike)
0939      * @see #toString(js.DateLike)
0940      * @see js.DateLike#toTimeString()
0941      * @since 1.0
0942      */
0943     public static final String toTimeString(DateLike d) {
0944         return d.toTimeString();
0945     }
0946     /**
0947      * <p>Returns a string that represents the date portion of the current date instance, 
0948      * expressed in the local time zone, using the local date formatting conventions.</p>
0949      * @param d The current date instance.
0950      * @return An implementation-dependent, human-readable string representation of the 
0951      * date portion of the current date instance, expressed in the local time zone and 
0952      * formatted according to local conventions.
0953      * @see #toDateString(js.DateLike)
0954      * @see #toLocaleString(js.DateLike)
0955      * @see #toLocaleTimeString(js.DateLike)
0956      * @see #toString(js.DateLike)
0957      * @see #toTimeString(js.DateLike)
0958      * @see js.DateLike#toLocaleDateString()
0959      * @since 1.0
0960      */
0961     public static final String toLocaleDateString(DateLike d) {
0962         return d.toLocaleDateString();
0963     }
0964     /**
0965      * <p>Returns a string that represents the time portion of the current date instance, 
0966      * expressed in the local time zone, using the local time formatting conventions.</p>
0967      * @param d The current date instance.
0968      * @return An implementation-dependent, human-readable string representation of the 
0969      * time portion of the current date instance, expressed in the local time zone and 
0970      * formatted according to local conventions.
0971      * @see #toDateString(js.DateLike)
0972      * @see #toLocaleDateString(js.DateLike)
0973      * @see #toLocaleString(js.DateLike)
0974      * @see #toString(js.DateLike)
0975      * @see #toTimeString(js.DateLike)
0976      * @see js.DateLike#toLocaleTimeString()
0977      * @since 1.0
0978      */
0979     public static final String toLocaleTimeString(DateLike d) {
0980         return d.toLocaleTimeString();
0981     }
0982     /**
0983      * <p>Converts the current date instance to a string, using universal time.</p>
0984      * @param d The current date instance.
0985      * @return A human-readable string representation, expressed in universal time, of the 
0986      * current date instance.
0987      * @see #toLocaleString(js.DateLike)
0988      * @see #toString(js.DateLike)
0989      * @see js.DateLike#toUTCString()
0990      * @since 1.0
0991      */
0992     public static final String toUTCString(DateLike d) {
0993         return d.toUTCString();
0994     }
0995     /**
0996      * <p>Converts the current date instance to a string using the local time zone.</p>
0997      * @param d The current date instance.
0998      * @return A human-readable string representation of the current date instance, 
0999      * expressed in the local time zone.
1000      * @see #toDateString(js.DateLike)
1001      * @see #toLocaleString(js.DateLike)
1002      * @see #toTimeString(js.DateLike)
1003      * @see #toUTCString(js.DateLike)
1004      * @see js.core.JsGlobal.Date#parse(Object)
1005      * @since 1.0
1006      */
1007     public static final String toString(DateLike d) {
1008         return d.toString();
1009     }
1010     /**
1011      * <p>Computes milliseconds that has elapsed since the argument date and time.</p>
1012      * @param d The date and time that the calculation starts with.
1013      * @return The elapsed time in milliseconds, 
1014      * @since 1.0
1015      */
1016     public static final Number elapse(DateLike d) {
1017         return elapse(d, Js.date());
1018     }
1019     /**
1020      * <p>Computes the difference in milliseconds between the two date and time arguments.</p>
1021      * @param d1 The date and time that the calculation starts with.
1022      * @param d2 The date and time that the calculation ends with.
1023      * @return The elapsed time in milliseconds, 
1024      * @since 1.0
1025      */
1026     public static final Number elapse(DateLike d2, DateLike d1) {
1027         return Js.sub(d2.valueOf(), d1.valueOf());
1028     }
1029 }