js/public/Date.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/public/Date.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef js_Date_h
    1.10 +#define js_Date_h
    1.11 +
    1.12 +#include "jstypes.h"
    1.13 +
    1.14 +namespace JS {
    1.15 +
    1.16 +// Year is a year, month is 0-11, day is 1-based.  The return value is
    1.17 +// a number of milliseconds since the epoch.  Can return NaN.
    1.18 +JS_PUBLIC_API(double)
    1.19 +MakeDate(double year, unsigned month, unsigned day);
    1.20 +
    1.21 +// Takes an integer number of milliseconds since the epoch and returns the
    1.22 +// year.  Can return NaN, and will do so if NaN is passed in.
    1.23 +JS_PUBLIC_API(double)
    1.24 +YearFromTime(double time);
    1.25 +
    1.26 +// Takes an integer number of milliseconds since the epoch and returns the
    1.27 +// month (0-11).  Can return NaN, and will do so if NaN is passed in.
    1.28 +JS_PUBLIC_API(double)
    1.29 +MonthFromTime(double time);
    1.30 +
    1.31 +// Takes an integer number of milliseconds since the epoch and returns the
    1.32 +// day (1-based).  Can return NaN, and will do so if NaN is passed in.
    1.33 +JS_PUBLIC_API(double)
    1.34 +DayFromTime(double time);
    1.35 +
    1.36 +} // namespace JS
    1.37 +
    1.38 +#endif /* js_Date_h */

mercurial