This repository has been archived by the owner on Jan 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Date.html
39 lines (39 loc) · 13.7 KB
/
Date.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html lang="en"><!-- use theme color or fallback -->
<!--use textcolor from settings, otherwise create a contrasting color to theme color-->
<head><meta charset="utf-8"/><link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet"/><link href="./bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet"/><link href="./bootstrap/css/bootstrap-select.min.css" rel="stylesheet"/><link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic,400italic" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,600,600italic,400" rel="stylesheet" type="text/css"/><link href="https://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet" type="text/css"/><script src="./jquery-1.9.1.min.js"></script><script src="./bootstrap/js/bootstrap.min.js"></script><script src="./bootstrap/js/bootstrap-select.min.js"></script><link href="./styles.css" rel="stylesheet"/><link href="./extra-styles.css" rel="stylesheet"/><link href="./haxe-nav.css" rel="stylesheet"/><script>var dox = {rootPath: "./",platforms: ["api"]};</script><script src="./nav.js"></script><script src="./index.js"></script><link rel="icon" href="./favicon.ico" type="image/x-icon"/><title>Date</title><meta name="description" content="The Date class provides a basic structure for date and time related
information. Date instances can be created by"/></head><body><style>
.navbar .brand {
display: inline-block;
float: none;
text-shadow: 0 0 0 transparent;
</style><nav class="nav"><div class="navbar"><div class="navbar-inner" style="background:#FAFAFA; border-bottom:1px solid rgba(0,0,0,.09)"><div class="container"><a class="brand" style="color:#000000" href="./">API Documentation</a></div></div></div></nav><div class="container main-content"><div class="row-fluid"><div class="span3"><div class="well sidebar-nav"><form class="form-search" id="searchForm"><div class="input-prepend input-block-level"><span class="add-on"><i class="icon-search"></i></span><input id="search" type="text" placeholder="Filter" autocomplete="off"/></div></form></div><div class="well sidebar-nav"><div id="nav"></div></div></div><div class="span9"><div class="page-header"><h1><small>class</small> Date</h1><h4><small><a href="./">no package</a></small></h4> <span class="label label-meta label-meta-directlyUsed" title="@:directlyUsed metadata">@:directlyUsed</span><span class="label label-meta label-meta-coreApi" title="@:coreApi metadata">@:coreApi</span><hr/></div><div class="body"><div class="doc doc-main"><div class="indent"><p>The Date class provides a basic structure for date and time related
information. Date instances can be created by</p><ul><li><code>new <a href="./Date.html">Date</a>()</code> for a specific date,</li><li><code><a href="./Date.html#now">Date.now</a>()</code> to obtain information about the current time,</li><li><code><a href="./Date.html#fromTime">Date.fromTime</a>()</code> with a given timestamp or</li><li><code><a href="./Date.html#fromString">Date.fromString</a>()</code> by parsing from a String.</li></ul>
<p>There are some extra functions available in the <code>DateTools</code> class.</p>
<p>In the context of Haxe dates, a timestamp is defined as the number of
milliseconds elapsed since 1st January 1970 UTC.</p>
<h2>Supported range</h2>
<p>Due to platform limitations, only dates in the range 1970 through 2038 are
supported consistently. Some targets may support dates outside this range,
depending on the OS at runtime. The <code><a href="./Date.html#fromTime">Date.fromTime</a></code> method will not work with
timestamps outside the range on any target.</p></div></div><h3 class="section">Constructor</h3><div class="fields"><div class="field "><a name="new"></a><h3 class="anchor"><code><a href="#new"><span class="identifier">new</span></a> (<span style="white-space:nowrap">year:<a class="type" title="The standard Int type." href="./Int.html">Int</a>,</span> <span style="white-space:nowrap">month:<a class="type" title="The standard Int type." href="./Int.html">Int</a>,</span> <span style="white-space:nowrap">day:<a class="type" title="The standard Int type." href="./Int.html">Int</a>,</span> <span style="white-space:nowrap">hour:<a class="type" title="The standard Int type." href="./Int.html">Int</a>,</span> <span style="white-space:nowrap">min:<a class="type" title="The standard Int type." href="./Int.html">Int</a>,</span> <span style="white-space:nowrap">sec:<a class="type" title="The standard Int type." href="./Int.html">Int</a></span>)</code></h3><div class="doc"><p>Creates a new date object from the given arguments.</p>
<p>The behaviour of a Date instance is only consistent across platforms if
the the arguments describe a valid date.</p><ul><li>month: 0 to 11 (note that this is zero-based)</li><li>day: 1 to 31</li><li>hour: 0 to 23</li><li>min: 0 to 59</li><li>sec: 0 to 59</li></ul></div></div></div><h3 class="section">Methods</h3><div class="fields"><div class="field "><a name="getDate"></a><h3 class="anchor"><code><a href="#getDate"><span class="identifier">getDate</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the day of <code>this</code> Date (1-31 range) in the local timezone.</p></div></div><div class="field "><a name="getDay"></a><h3 class="anchor"><code><a href="#getDay"><span class="identifier">getDay</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the day of the week of <code>this</code> Date (0-6 range, where <code>0</code> is Sunday)
in the local timezone.</p></div></div><div class="field "><a name="getFullYear"></a><h3 class="anchor"><code><a href="#getFullYear"><span class="identifier">getFullYear</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the full year of <code>this</code> Date (4 digits) in the local timezone.</p></div></div><div class="field "><a name="getHours"></a><h3 class="anchor"><code><a href="#getHours"><span class="identifier">getHours</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the hours of <code>this</code> Date (0-23 range) in the local timezone.</p></div></div><div class="field "><a name="getMinutes"></a><h3 class="anchor"><code><a href="#getMinutes"><span class="identifier">getMinutes</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the minutes of <code>this</code> Date (0-59 range) in the local timezone.</p></div></div><div class="field "><a name="getMonth"></a><h3 class="anchor"><code><a href="#getMonth"><span class="identifier">getMonth</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the month of <code>this</code> Date (0-11 range) in the local timezone.
Note that the month number is zero-based.</p></div></div><div class="field "><a name="getSeconds"></a><h3 class="anchor"><code><a href="#getSeconds"><span class="identifier">getSeconds</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the seconds of <code>this</code> Date (0-59 range) in the local timezone.</p></div></div><div class="field "><a name="getTime"></a><h3 class="anchor"><code><a href="#getTime"><span class="identifier">getTime</span></a> ():<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="./Float.html">Float</a></code></h3><div class="doc"><p>Returns the timestamp (in milliseconds) of <code>this</code> date.
On cpp and neko, this function only has a second resolution, so the
result will always be a multiple of <code>1000.0</code>, e.g. <code>1454698271000.0</code>.
To obtain the current timestamp with better precision on cpp and neko,
see the <code>Sys.time</code> API.</p>
<p>For measuring time differences with millisecond accuracy on
all platforms, see <code>haxe.Timer.stamp</code>.</p></div></div><div class="field "><a name="getTimezoneOffset"></a><h3 class="anchor"><code><a href="#getTimezoneOffset"><span class="identifier">getTimezoneOffset</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the time zone difference of <code>this</code> Date in the current locale
to UTC, in minutes.</p>
<p>Assuming the function is executed on a machine in a UTC+2 timezone,
<code><a href="./Date.html#now">Date.now</a>().getTimezoneOffset()</code> will return <code>-120</code>.</p></div></div><div class="field "><a name="getUTCDate"></a><h3 class="anchor"><code><a href="#getUTCDate"><span class="identifier">getUTCDate</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the day of <code>this</code> Date (1-31 range) in UTC.</p></div></div><div class="field "><a name="getUTCDay"></a><h3 class="anchor"><code><a href="#getUTCDay"><span class="identifier">getUTCDay</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the day of the week of <code>this</code> Date (0-6 range, where <code>0</code> is Sunday)
in UTC.</p></div></div><div class="field "><a name="getUTCFullYear"></a><h3 class="anchor"><code><a href="#getUTCFullYear"><span class="identifier">getUTCFullYear</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the full year of <code>this</code> Date (4 digits) in UTC.</p></div></div><div class="field "><a name="getUTCHours"></a><h3 class="anchor"><code><a href="#getUTCHours"><span class="identifier">getUTCHours</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the hours of <code>this</code> Date (0-23 range) in UTC.</p></div></div><div class="field "><a name="getUTCMinutes"></a><h3 class="anchor"><code><a href="#getUTCMinutes"><span class="identifier">getUTCMinutes</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the minutes of <code>this</code> Date (0-59 range) in UTC.</p></div></div><div class="field "><a name="getUTCMonth"></a><h3 class="anchor"><code><a href="#getUTCMonth"><span class="identifier">getUTCMonth</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the month of <code>this</code> Date (0-11 range) in UTC.
Note that the month number is zero-based.</p></div></div><div class="field "><a name="getUTCSeconds"></a><h3 class="anchor"><code><a href="#getUTCSeconds"><span class="identifier">getUTCSeconds</span></a> ():<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the seconds of <code>this</code> Date (0-59 range) in UTC.</p></div></div><div class="field "><a name="toString"></a><h3 class="anchor"><code><span class="label label-inline">inline</span><a href="#toString"><span class="identifier">toString</span></a> ():<a class="type" title="The basic String class." href="./String.html">String</a></code></h3><div class="doc"><p>Returns a string representation of <code>this</code> Date in the local timezone
using the standard format <code>YYYY-MM-DD HH:MM:SS</code>. See <code>DateTools.format</code> for
other formatting rules.</p></div></div></div><h3 class="section">Static methods</h3><div class="fields"><div class="field "><a name="fromString"></a><h3 class="anchor"><code><span class="label label-static">static</span><span class="label label-inline">inline</span><a href="#fromString"><span class="identifier">fromString</span></a> (<span style="white-space:nowrap">s:<a class="type" title="The basic String class." href="./String.html">String</a></span>):<a class="type" title="The Date class provides a basic structure for date and time related information." href="./Date.html">Date</a></code></h3><div class="doc"><p>Creates a Date from the formatted string <code>s</code>. The following formats are
accepted by the function:</p><ul><li><code>"YYYY-MM-DD hh:mm:ss"</code></li><li><code>"YYYY-MM-DD"</code></li><li><code>"hh:mm:ss"</code></li></ul>
<p>The first two formats expressed a date in local time. The third is a time
relative to the UTC epoch.</p></div></div><div class="field "><a name="fromTime"></a><h3 class="anchor"><code><span class="label label-static">static</span><span class="label label-inline">inline</span><a href="#fromTime"><span class="identifier">fromTime</span></a> (<span style="white-space:nowrap">t:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="./Float.html">Float</a></span>):<a class="type" title="The Date class provides a basic structure for date and time related information." href="./Date.html">Date</a></code></h3><div class="doc"><p>Creates a Date from the timestamp (in milliseconds) <code>t</code>.</p></div></div><div class="field "><a name="now"></a><h3 class="anchor"><code><span class="label label-static">static</span><span class="label label-inline">inline</span><a href="#now"><span class="identifier">now</span></a> ():<a class="type" title="The Date class provides a basic structure for date and time related information." href="./Date.html">Date</a></code></h3><div class="doc"><p>Returns a Date representing the current local time.</p></div></div></div></div></div></div></div><footer class="section site-footer" style="background:#FAFAFA"><div class="container"><div class="copyright"><p style="color:#000000">© 2019 </p></div></div></footer><script src=".//highlighter.js"></script><link href="./highlighter.css" rel="stylesheet"/></body></html>