| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta name="generator" content="made with love by dartdoc 0.8.1"> |
| <title>DateTime class - ex library - Dart API</title> |
| <!-- required because all the links are pseudo-absolute --> |
| <base href=".."> |
| |
| <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro|Roboto:500,400italic,300,400' rel='stylesheet' type='text/css'> |
| <link rel="stylesheet" href="static-assets/prettify.css"> |
| <link rel="stylesheet" href="static-assets/css/bootstrap.min.css"> |
| <link rel="stylesheet" href="static-assets/styles.css"> |
| |
| <meta name="description" content="API docs for the DateTime class from the ex library, for the Dart programming language."> |
| <link rel="icon" href="static-assets/favicon.png"> |
| |
| <!-- Do not remove placeholder --> |
| <!-- Header Placeholder --> |
| </head> |
| |
| <body> |
| |
| <div id="overlay-under-drawer"></div> |
| |
| <header class="container-fluid" id="title"> |
| <nav class="navbar navbar-fixed-top"> |
| <div class="container"> |
| <div class="row"> |
| <div class="col-sm-12 contents"> |
| <button id="sidenav-left-toggle" type="button"> </button> |
| <ol class="breadcrumbs gt-separated hidden-xs"> |
| <li><a href="index.html">test_package</a></li> |
| <li><a href="ex/ex-library.html">ex</a></li> |
| <li class="self-crumb">DateTime</li> |
| </ol> |
| <div class="self-name">DateTime</div> |
| <form class="search navbar-right" role="search"> |
| <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search..."> |
| </form> |
| </div> <!-- /col --> |
| </div> <!-- /row --> |
| </div> <!-- /container --> |
| </nav> |
| |
| <div class="container masthead"> |
| <div class="row"> |
| <div class="col-sm-12 contents"> |
| <ol class="breadcrumbs gt-separated visible-xs"> |
| <li><a href="index.html">test_package</a></li> |
| <li><a href="ex/ex-library.html">ex</a></li> |
| <li class="self-crumb">DateTime</li> |
| </ol> |
| <div class="title-description"> |
| <h1 class="title"> |
| <span class="kind">class</span> DateTime |
| </h1> |
| </div> |
| <ul class="subnav"> |
| <li><a href="ex/DateTime-class.html#constants">Constants</a></li> |
| <li><a href="ex/DateTime-class.html#static-methods">Static Methods</a></li> |
| <li><a href="ex/DateTime-class.html#instance-properties">Properties</a></li> |
| <li><a href="ex/DateTime-class.html#constructors">Constructors</a></li> |
| <li><a href="ex/DateTime-class.html#operators">Operators</a></li> |
| <li><a href="ex/DateTime-class.html#instance-methods">Methods</a></li> |
| </ul> |
| </div> <!-- /col --> |
| </div> <!-- /row --> |
| </div> <!-- /container --> |
| |
| </header> |
| |
| <div class="container body"> |
| <div class="row"> |
| |
| <div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left"> |
| <h5><a href="index.html">test_package</a></h5> |
| <h5><a href="ex/ex-library.html">ex</a></h5> |
| |
| <ol> |
| <li class="section-title"><a href="ex/ex-library.html#constants">Constants</a></li> |
| <li><a href="ex/COLOR.html">COLOR</a></li> |
| <li><a href="ex/COLOR_GREEN.html">COLOR_GREEN</a></li> |
| <li><a href="ex/COLOR_ORANGE.html">COLOR_ORANGE</a></li> |
| <li><a href="ex/COMPLEX_COLOR.html">COMPLEX_COLOR</a></li> |
| <li><a href="ex/deprecated.html">deprecated</a></li> |
| <li><a href="ex/incorrectDocReference.html">incorrectDocReference</a></li> |
| <li><a href="ex/incorrectDocReferenceFromEx.html">incorrectDocReferenceFromEx</a></li> |
| <li><a href="ex/MY_CAT.html">MY_CAT</a></li> |
| |
| <li class="section-title"><a href="ex/ex-library.html#typedefs">Typedefs</a></li> |
| <li><a href="ex/processMessage.html">processMessage</a></li> |
| |
| <li class="section-title"><a href="ex/ex-library.html#properties">Properties</a></li> |
| <li><a href="ex/number.html">number</a></li> |
| <li><a href="ex/y.html">y</a></li> |
| |
| <li class="section-title"><a href="ex/ex-library.html#functions">Functions</a></li> |
| <li><a href="ex/function1.html">function1</a></li> |
| |
| <li class="section-title"><a href="ex/ex-library.html#enums">Enums</a></li> |
| <li><a href="ex/Animal-class.html">Animal</a></li> |
| |
| <li class="section-title"><a href="ex/ex-library.html#classes">Classes</a></li> |
| <li><a href="ex/Apple-class.html">Apple</a></li> |
| <li><a href="ex/B-class.html">B</a></li> |
| <li><a href="ex/Cat-class.html">Cat</a></li> |
| <li><a href="ex/CatString-class.html">CatString</a></li> |
| <li><a href="ex/ConstantCat-class.html">ConstantCat</a></li> |
| <li><a href="ex/DateTime-class.html">DateTime</a></li> |
| <li><a href="ex/Deprecated-class.html">Deprecated</a></li> |
| <li><a href="ex/Dog-class.html">Dog</a></li> |
| <li><a href="ex/E-class.html">E</a></li> |
| <li><a href="ex/F-class.html">F</a></li> |
| <li><a href="ex/ForAnnotation-class.html">ForAnnotation</a></li> |
| <li><a href="ex/HasAnnotation-class.html">HasAnnotation</a></li> |
| <li><a href="ex/Helper-class.html">Helper</a></li> |
| <li><a href="ex/Klass-class.html">Klass</a></li> |
| <li><a href="ex/PublicClassExtendsPrivateClass-class.html">PublicClassExtendsPrivateClass</a></li> |
| <li><a href="ex/PublicClassImplementsPrivateInterface-class.html">PublicClassImplementsPrivateInterface</a></li> |
| <li><a href="ex/ShapeType-class.html">ShapeType</a></li> |
| <li><a href="ex/SpecializedDuration-class.html">SpecializedDuration</a></li> |
| |
| <li class="section-title"><a href="ex/ex-library.html#exceptions">Exceptions</a></li> |
| <li><a href="ex/MyError-class.html">MyError</a></li> |
| <li><a href="ex/MyErrorImplements-class.html">MyErrorImplements</a></li> |
| <li><a href="ex/MyException-class.html">MyException</a></li> |
| <li><a href="ex/MyExceptionImplements-class.html">MyExceptionImplements</a></li> |
| </ol> |
| </div> |
| |
| <div class="col-xs-12 col-sm-9 col-md-8 main-content"> |
| |
| <section class="desc markdown"> |
| <p>An instant in time, such as July 20, 1969, 8:18pm GMT.</p> |
| <p>Create a DateTime object by using one of the constructors |
| or by parsing a correctly formatted string, |
| which complies with a subset of ISO 8601. |
| Note that hours are specified between 0 and 23, |
| as in a 24-hour clock. |
| For example:</p> |
| <pre class="prettyprint lang-dart"><code>DateTime now = new DateTime.now(); |
| DateTime berlinWallFell = new DateTime(1989, 11, 9); |
| DateTime moonLanding = DateTime.parse("1969-07-20 20:18:00"); // 8:18pm |
| </code></pre> |
| <p>A DateTime object is anchored either in the UTC time zone |
| or in the local time zone of the current computer |
| when the object is created.</p> |
| <p>Once created, neither the value nor the time zone |
| of a DateTime object may be changed.</p> |
| <p>You can use properties to get |
| the individual units of a DateTime object.</p> |
| <pre class="prettyprint lang-dart"><code>assert(berlinWallFell.month == 11); |
| assert(moonLanding.hour == 20); |
| </code></pre> |
| <p>For convenience and readability, |
| the DateTime class provides a constant for each day and month |
| name—for example, <a href="ex/DateTime/AUGUST.html">AUGUST</a> and <a href="ex/DateTime/FRIDAY.html">FRIDAY</a>. |
| You can use these constants to improve code readibility:</p> |
| <pre class="prettyprint lang-dart"><code>DateTime berlinWallFell = new DateTime(1989, DateTime.NOVEMBER, 9); |
| assert(berlinWallFell.weekday == DateTime.THURSDAY); |
| </code></pre> |
| <p>Day and month values begin at 1, and the week starts on Monday. |
| That is, the constants <a href="ex/DateTime/JANUARY.html">JANUARY</a> and <a href="ex/DateTime/MONDAY.html">MONDAY</a> are both 1.</p> |
| <h2>Working with UTC and local time</h2> |
| <p>A DateTime object is in the local time zone |
| unless explicitly created in the UTC time zone.</p> |
| <pre class="prettyprint lang-dart"><code>DateTime dDay = new DateTime.utc(1944, 6, 6); |
| </code></pre> |
| <p>Use <a href="ex/DateTime/isUtc.html">isUtc</a> to determine whether a DateTime object is based in UTC. |
| Use the methods <a href="ex/DateTime/toLocal.html">toLocal</a> and <a href="ex/DateTime/toUtc.html">toUtc</a> |
| to get the equivalent date/time value specified in the other time zone. |
| Use <a href="ex/DateTime/timeZoneName.html">timeZoneName</a> to get an abbreviated name of the time zone |
| for the DateTime object. |
| To find the difference |
| between UTC and the time zone of a DateTime object |
| call <a href="ex/DateTime/timeZoneOffset.html">timeZoneOffset</a>.</p> |
| <h2>Comparing DateTime objects</h2> |
| <p>The DateTime class contains several handy methods, |
| such as <a href="ex/DateTime/isAfter.html">isAfter</a>, <a href="ex/DateTime/isBefore.html">isBefore</a>, and <a href="ex/DateTime/isAtSameMomentAs.html">isAtSameMomentAs</a>, |
| for comparing DateTime objects.</p> |
| <pre class="prettyprint lang-dart"><code>assert(berlinWallFell.isAfter(moonLanding) == true); |
| assert(berlinWallFell.isBefore(moonLanding) == false); |
| </code></pre> |
| <h2>Using DateTime with Duration</h2> |
| <p>Use the <a href="ex/DateTime/add.html">add</a> and <a href="ex/DateTime/subtract.html">subtract</a> methods with a <code>Duration</code> object |
| to create a new DateTime object based on another. |
| For example, to find the date that is sixty days after today, write:</p> |
| <pre class="prettyprint lang-dart"><code>DateTime today = new DateTime.now(); |
| DateTime sixtyDaysFromNow = today.add(new Duration(days: 60)); |
| </code></pre> |
| <p>To find out how much time is between two DateTime objects use |
| <a href="ex/DateTime/difference.html">difference</a>, which returns a <code>Duration</code> object:</p> |
| <pre class="prettyprint lang-dart"><code>Duration difference = berlinWallFell.difference(moonLanding) |
| assert(difference.inDays == 7416); |
| </code></pre> |
| <p>The difference between two dates in different time zones |
| is just the number of nanoseconds between the two points in time. |
| It doesn't take calendar days into account. |
| That means that the difference between two midnights in local time may be |
| less than 24 hours times the number of days between them, |
| if there is a daylight saving change in between. |
| If the difference above is calculated using Australian local time, the |
| difference is 7415 days and 23 hours, which is only 7415 whole days as |
| reported by <code>inDays</code>.</p> |
| <h2>Other resources</h2> |
| <p>See <code>Duration</code> to represent a span of time. |
| See <code>Stopwatch</code> to measure timespans.</p> |
| <p>The DateTime class does not provide internationalization. |
| To internationalize your code, use |
| the <a href="http://pub.dartlang.org/packages/intl">intl</a> package.</p> |
| </section> |
| |
| <section> |
| <dl class="dl-horizontal"> |
| |
| <dt>Implements</dt> |
| <dd> |
| <ul class="comma-separated clazz-relationships"> |
| <li>Comparable</li> |
| </ul> |
| </dd> |
| |
| |
| |
| </dl> |
| </section> |
| |
| <section class="summary offset-anchor" id="constants"> |
| <h2>Constants</h2> |
| |
| <dl class="properties"> |
| <dt id="APRIL" class="constant"> |
| <span class="name "><a href="ex/DateTime/APRIL.html">APRIL</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>4</code></span> |
| </div> |
| </dd> |
| <dt id="AUGUST" class="constant"> |
| <span class="name "><a href="ex/DateTime/AUGUST.html">AUGUST</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>8</code></span> |
| </div> |
| </dd> |
| <dt id="DAYS_PER_WEEK" class="constant"> |
| <span class="name "><a href="ex/DateTime/DAYS_PER_WEEK.html">DAYS_PER_WEEK</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>7</code></span> |
| </div> |
| </dd> |
| <dt id="DECEMBER" class="constant"> |
| <span class="name "><a href="ex/DateTime/DECEMBER.html">DECEMBER</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>12</code></span> |
| </div> |
| </dd> |
| <dt id="FEBRUARY" class="constant"> |
| <span class="name "><a href="ex/DateTime/FEBRUARY.html">FEBRUARY</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>2</code></span> |
| </div> |
| </dd> |
| <dt id="FRIDAY" class="constant"> |
| <span class="name "><a href="ex/DateTime/FRIDAY.html">FRIDAY</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>5</code></span> |
| </div> |
| </dd> |
| <dt id="JANUARY" class="constant"> |
| <span class="name "><a href="ex/DateTime/JANUARY.html">JANUARY</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>1</code></span> |
| </div> |
| </dd> |
| <dt id="JULY" class="constant"> |
| <span class="name "><a href="ex/DateTime/JULY.html">JULY</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>7</code></span> |
| </div> |
| </dd> |
| <dt id="JUNE" class="constant"> |
| <span class="name "><a href="ex/DateTime/JUNE.html">JUNE</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>6</code></span> |
| </div> |
| </dd> |
| <dt id="MARCH" class="constant"> |
| <span class="name "><a href="ex/DateTime/MARCH.html">MARCH</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>3</code></span> |
| </div> |
| </dd> |
| <dt id="MAY" class="constant"> |
| <span class="name "><a href="ex/DateTime/MAY.html">MAY</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>5</code></span> |
| </div> |
| </dd> |
| <dt id="MONDAY" class="constant"> |
| <span class="name "><a href="ex/DateTime/MONDAY.html">MONDAY</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>1</code></span> |
| </div> |
| </dd> |
| <dt id="MONTHS_PER_YEAR" class="constant"> |
| <span class="name "><a href="ex/DateTime/MONTHS_PER_YEAR.html">MONTHS_PER_YEAR</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>12</code></span> |
| </div> |
| </dd> |
| <dt id="NOVEMBER" class="constant"> |
| <span class="name "><a href="ex/DateTime/NOVEMBER.html">NOVEMBER</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>11</code></span> |
| </div> |
| </dd> |
| <dt id="OCTOBER" class="constant"> |
| <span class="name "><a href="ex/DateTime/OCTOBER.html">OCTOBER</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>10</code></span> |
| </div> |
| </dd> |
| <dt id="SATURDAY" class="constant"> |
| <span class="name "><a href="ex/DateTime/SATURDAY.html">SATURDAY</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>6</code></span> |
| </div> |
| </dd> |
| <dt id="SEPTEMBER" class="constant"> |
| <span class="name "><a href="ex/DateTime/SEPTEMBER.html">SEPTEMBER</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>9</code></span> |
| </div> |
| </dd> |
| <dt id="SUNDAY" class="constant"> |
| <span class="name "><a href="ex/DateTime/SUNDAY.html">SUNDAY</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>7</code></span> |
| </div> |
| </dd> |
| <dt id="THURSDAY" class="constant"> |
| <span class="name "><a href="ex/DateTime/THURSDAY.html">THURSDAY</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>4</code></span> |
| </div> |
| </dd> |
| <dt id="TUESDAY" class="constant"> |
| <span class="name "><a href="ex/DateTime/TUESDAY.html">TUESDAY</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>2</code></span> |
| </div> |
| </dd> |
| <dt id="WEDNESDAY" class="constant"> |
| <span class="name "><a href="ex/DateTime/WEDNESDAY.html">WEDNESDAY</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div> |
| <span class="features">const</span> |
| <span class="signature"><code>3</code></span> |
| </div> |
| </dd> |
| </dl> |
| </section> |
| |
| |
| <section class="summary offset-anchor" id="static-methods"> |
| <h2>Static Methods</h2> |
| <dl class="callables"> |
| <dt id="parse" class="callable"> |
| <span class="name "><a href="ex/DateTime/parse.html">parse</a></span><span class="signature">(<wbr><span class="parameter" id="parse-param-formattedString"><span class="type-annotation">String</span> <span class="parameter-name">formattedString</span></span>) |
| <span class="returntype parameter">→ <a href="ex/DateTime-class.html">DateTime</a></span> |
| </span> |
| </dt> |
| <dd> |
| <p>Constructs a new <a href="ex/DateTime-class.html">DateTime</a> instance based on <code>formattedString</code>.<a href="ex/DateTime/parse.html">…</a> |
| </p> |
| </dd> |
| </dl> |
| </section> |
| |
| <section class="summary offset-anchor" id="constructors"> |
| <h2>Constructors</h2> |
| |
| <dl class="constructor-summary-list"> |
| <dt id="DateTime" class="callable"> |
| <span class="name"><a href="ex/DateTime/DateTime.html">DateTime</a></span><span class="signature">(<span class="parameter" id="-param-year"><span class="type-annotation">int</span> <span class="parameter-name">year</span></span>, [<span class="parameter" id="-param-month"><span class="type-annotation">int</span> <span class="parameter-name">month</span> = <span class="default-value">1</span></span>, <span class="parameter" id="-param-day"><span class="type-annotation">int</span> <span class="parameter-name">day</span> = <span class="default-value">1</span></span>, <span class="parameter" id="-param-hour"><span class="type-annotation">int</span> <span class="parameter-name">hour</span> = <span class="default-value">0</span></span>, <span class="parameter" id="-param-minute"><span class="type-annotation">int</span> <span class="parameter-name">minute</span> = <span class="default-value">0</span></span>, <span class="parameter" id="-param-second"><span class="type-annotation">int</span> <span class="parameter-name">second</span> = <span class="default-value">0</span></span>, <span class="parameter" id="-param-millisecond"><span class="type-annotation">int</span> <span class="parameter-name">millisecond</span> = <span class="default-value">0</span></span>])</span> |
| </dt> |
| <dd> |
| <p>Constructs a <a href="ex/DateTime-class.html">DateTime</a> instance specified in the local time zone.<a href="ex/DateTime/DateTime.html">…</a> |
| </p> |
| </dd> |
| <dt id="DateTime.fromMillisecondsSinceEpoch" class="callable"> |
| <span class="name"><a href="ex/DateTime/DateTime.fromMillisecondsSinceEpoch.html">DateTime.fromMillisecondsSinceEpoch</a></span><span class="signature">(<span class="parameter" id="fromMillisecondsSinceEpoch-param-millisecondsSinceEpoch"><span class="type-annotation">int</span> <span class="parameter-name">millisecondsSinceEpoch</span></span>, {<span class="parameter" id="fromMillisecondsSinceEpoch-param-isUtc"><span class="type-annotation">bool</span> <span class="parameter-name">isUtc</span>: <span class="default-value">false</span></span>})</span> |
| </dt> |
| <dd> |
| <p>Constructs a new <a href="ex/DateTime-class.html">DateTime</a> instance |
| with the given <code>millisecondsSinceEpoch</code>.<a href="ex/DateTime/DateTime.fromMillisecondsSinceEpoch.html">…</a> |
| </p> |
| </dd> |
| <dt id="DateTime.now" class="callable"> |
| <span class="name"><a href="ex/DateTime/DateTime.now.html">DateTime.now</a></span><span class="signature">()</span> |
| </dt> |
| <dd> |
| <p>Constructs a <a href="ex/DateTime-class.html">DateTime</a> instance with current date and time in the |
| local time zone.<a href="ex/DateTime/DateTime.now.html">…</a> |
| </p> |
| </dd> |
| <dt id="DateTime.utc" class="callable"> |
| <span class="name"><a href="ex/DateTime/DateTime.utc.html">DateTime.utc</a></span><span class="signature">(<span class="parameter" id="utc-param-year"><span class="type-annotation">int</span> <span class="parameter-name">year</span></span>, [<span class="parameter" id="utc-param-month"><span class="type-annotation">int</span> <span class="parameter-name">month</span> = <span class="default-value">1</span></span>, <span class="parameter" id="utc-param-day"><span class="type-annotation">int</span> <span class="parameter-name">day</span> = <span class="default-value">1</span></span>, <span class="parameter" id="utc-param-hour"><span class="type-annotation">int</span> <span class="parameter-name">hour</span> = <span class="default-value">0</span></span>, <span class="parameter" id="utc-param-minute"><span class="type-annotation">int</span> <span class="parameter-name">minute</span> = <span class="default-value">0</span></span>, <span class="parameter" id="utc-param-second"><span class="type-annotation">int</span> <span class="parameter-name">second</span> = <span class="default-value">0</span></span>, <span class="parameter" id="utc-param-millisecond"><span class="type-annotation">int</span> <span class="parameter-name">millisecond</span> = <span class="default-value">0</span></span>])</span> |
| </dt> |
| <dd> |
| <p>Constructs a <a href="ex/DateTime-class.html">DateTime</a> instance specified in the UTC time zone.<a href="ex/DateTime/DateTime.utc.html">…</a> |
| </p> |
| </dd> |
| </dl> |
| </section> |
| |
| <section class="summary offset-anchor" id="instance-properties"> |
| <h2>Properties</h2> |
| |
| <dl class="properties"> |
| <dt id="day" class="property"> |
| <span class="name"><a href="ex/DateTime/day.html">day</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p>The day of the month <code>1..31</code>.<a href="ex/DateTime/day.html">…</a> |
| </p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="hashCode" class="property"> |
| <span class="name"><a href="ex/DateTime/hashCode.html">hashCode</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p></p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="hour" class="property"> |
| <span class="name"><a href="ex/DateTime/hour.html">hour</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p>The hour of the day, expressed as in a 24-hour clock <code>0..23</code>.<a href="ex/DateTime/hour.html">…</a> |
| </p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="isUtc" class="property"> |
| <span class="name"><a href="ex/DateTime/isUtc.html">isUtc</a></span> |
| <span class="signature">→ bool</span> |
| </dt> |
| <dd> |
| <p>True if this <a href="ex/DateTime-class.html">DateTime</a> is set to UTC time.<a href="ex/DateTime/isUtc.html">…</a> |
| </p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="millisecond" class="property"> |
| <span class="name"><a href="ex/DateTime/millisecond.html">millisecond</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p>The millisecond <code>0...999</code>.<a href="ex/DateTime/millisecond.html">…</a> |
| </p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="millisecondsSinceEpoch" class="property"> |
| <span class="name"><a href="ex/DateTime/millisecondsSinceEpoch.html">millisecondsSinceEpoch</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p>The number of milliseconds since |
| the "Unix epoch" 1970-01-01T00:00:00Z (UTC).<a href="ex/DateTime/millisecondsSinceEpoch.html">…</a> |
| </p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="minute" class="property"> |
| <span class="name"><a href="ex/DateTime/minute.html">minute</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p>The minute <code>0...59</code>.<a href="ex/DateTime/minute.html">…</a> |
| </p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="month" class="property"> |
| <span class="name"><a href="ex/DateTime/month.html">month</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p>The month <code>1..12</code>.<a href="ex/DateTime/month.html">…</a> |
| </p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="runtimeType" class="property inherited"> |
| <span class="name"><a href="ex/DateTime/runtimeType.html">runtimeType</a></span> |
| <span class="signature">→ Type</span> |
| </dt> |
| <dd class="inherited"> |
| <p>A representation of the runtime type of the object.</p> |
| <div class="features"> |
| read-only, inherited |
| </div> |
| </dd> |
| <dt id="second" class="property"> |
| <span class="name"><a href="ex/DateTime/second.html">second</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p>The second <code>0...59</code>.<a href="ex/DateTime/second.html">…</a> |
| </p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="timeZoneName" class="property"> |
| <span class="name"><a href="ex/DateTime/timeZoneName.html">timeZoneName</a></span> |
| <span class="signature">→ String</span> |
| </dt> |
| <dd> |
| <p>The abbreviated time zone name—for example, |
| <code>"CET"</code> or <code>"CEST"</code>.</p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="timeZoneOffset" class="property"> |
| <span class="name"><a href="ex/DateTime/timeZoneOffset.html">timeZoneOffset</a></span> |
| <span class="signature">→ Duration</span> |
| </dt> |
| <dd> |
| <p>The time zone offset, which |
| is the difference between local time and UTC.<a href="ex/DateTime/timeZoneOffset.html">…</a> |
| </p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="weekday" class="property"> |
| <span class="name"><a href="ex/DateTime/weekday.html">weekday</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p>The day of the week <code>MONDAY</code>..<code>SUNDAY</code>.<a href="ex/DateTime/weekday.html">…</a> |
| </p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| <dt id="year" class="property"> |
| <span class="name"><a href="ex/DateTime/year.html">year</a></span> |
| <span class="signature">→ int</span> |
| </dt> |
| <dd> |
| <p>The year.<a href="ex/DateTime/year.html">…</a> |
| </p> |
| <div class="features"> |
| read-only |
| </div> |
| </dd> |
| </dl> |
| </section> |
| |
| <section class="summary offset-anchor" id="operators"> |
| <h2>Operators</h2> |
| <dl class="callables"> |
| <dt id="operator ==" class="callable"> |
| <span class="name "><a href="ex/DateTime/operator_equals.html">operator ==</a></span><span class="signature">(<wbr><span class="parameter" id="==-param-other"><span class="parameter-name">other</span></span>) |
| <span class="returntype parameter">→ bool</span> |
| </span> |
| </dt> |
| <dd> |
| <p>Returns true if <code>other</code> is a <a href="ex/DateTime-class.html">DateTime</a> at the same moment and in the |
| same time zone (UTC or local).<a href="ex/DateTime/operator_equals.html">…</a> |
| </p> |
| </dd> |
| </dl> |
| </section> |
| |
| <section class="summary offset-anchor" id="instance-methods"> |
| <h2>Methods</h2> |
| <dl class="callables"> |
| <dt id="add" class="callable"> |
| <span class="name "><a href="ex/DateTime/add.html">add</a></span><span class="signature">(<wbr><span class="parameter" id="add-param-duration"><span class="type-annotation">Duration</span> <span class="parameter-name">duration</span></span>) |
| <span class="returntype parameter">→ <a href="ex/DateTime-class.html">DateTime</a></span> |
| </span> |
| </dt> |
| <dd> |
| <p>Returns a new <a href="ex/DateTime-class.html">DateTime</a> instance with <code>duration</code> added to <code>this</code>.<a href="ex/DateTime/add.html">…</a> |
| </p> |
| </dd> |
| <dt id="compareTo" class="callable"> |
| <span class="name "><a href="ex/DateTime/compareTo.html">compareTo</a></span><span class="signature">(<wbr><span class="parameter" id="compareTo-param-other"><span class="type-annotation"><a href="ex/DateTime-class.html">DateTime</a></span> <span class="parameter-name">other</span></span>) |
| <span class="returntype parameter">→ int</span> |
| </span> |
| </dt> |
| <dd> |
| <p>Compares this DateTime object to <code>other</code>, |
| returning zero if the values are equal.<a href="ex/DateTime/compareTo.html">…</a> |
| </p> |
| </dd> |
| <dt id="difference" class="callable"> |
| <span class="name "><a href="ex/DateTime/difference.html">difference</a></span><span class="signature">(<wbr><span class="parameter" id="difference-param-other"><span class="type-annotation"><a href="ex/DateTime-class.html">DateTime</a></span> <span class="parameter-name">other</span></span>) |
| <span class="returntype parameter">→ Duration</span> |
| </span> |
| </dt> |
| <dd> |
| <p>Returns a <code>Duration</code> with the difference between <code>this</code> and <code>other</code>.<a href="ex/DateTime/difference.html">…</a> |
| </p> |
| </dd> |
| <dt id="isAfter" class="callable"> |
| <span class="name "><a href="ex/DateTime/isAfter.html">isAfter</a></span><span class="signature">(<wbr><span class="parameter" id="isAfter-param-other"><span class="type-annotation"><a href="ex/DateTime-class.html">DateTime</a></span> <span class="parameter-name">other</span></span>) |
| <span class="returntype parameter">→ bool</span> |
| </span> |
| </dt> |
| <dd> |
| <p>Returns true if <code>this</code> occurs after <code>other</code>.<a href="ex/DateTime/isAfter.html">…</a> |
| </p> |
| </dd> |
| <dt id="isAtSameMomentAs" class="callable"> |
| <span class="name "><a href="ex/DateTime/isAtSameMomentAs.html">isAtSameMomentAs</a></span><span class="signature">(<wbr><span class="parameter" id="isAtSameMomentAs-param-other"><span class="type-annotation"><a href="ex/DateTime-class.html">DateTime</a></span> <span class="parameter-name">other</span></span>) |
| <span class="returntype parameter">→ bool</span> |
| </span> |
| </dt> |
| <dd> |
| <p>Returns true if <code>this</code> occurs at the same moment as <code>other</code>.<a href="ex/DateTime/isAtSameMomentAs.html">…</a> |
| </p> |
| </dd> |
| <dt id="isBefore" class="callable"> |
| <span class="name "><a href="ex/DateTime/isBefore.html">isBefore</a></span><span class="signature">(<wbr><span class="parameter" id="isBefore-param-other"><span class="type-annotation"><a href="ex/DateTime-class.html">DateTime</a></span> <span class="parameter-name">other</span></span>) |
| <span class="returntype parameter">→ bool</span> |
| </span> |
| </dt> |
| <dd> |
| <p>Returns true if <code>this</code> occurs before <code>other</code>.<a href="ex/DateTime/isBefore.html">…</a> |
| </p> |
| </dd> |
| <dt id="noSuchMethod" class="callable inherited"> |
| <span class="name "><a href="ex/DateTime/noSuchMethod.html">noSuchMethod</a></span><span class="signature">(<wbr><span class="parameter" id="noSuchMethod-param-invocation"><span class="type-annotation">Invocation</span> <span class="parameter-name">invocation</span></span>) |
| <span class="returntype parameter">→ dynamic</span> |
| </span> |
| </dt> |
| <dd class="inherited"> |
| <p><code>noSuchMethod</code> is invoked when users invoke a non-existent method |
| on an object. The name of the method and the arguments of the |
| invocation are passed to <code>noSuchMethod</code> in an <code>Invocation</code>. |
| If <code>noSuchMethod</code> returns a value, that value becomes the result of |
| the original invocation.<a href="ex/DateTime/noSuchMethod.html">…</a> |
| </p> |
| <div class="features">inherited</div> |
| </dd> |
| <dt id="subtract" class="callable"> |
| <span class="name "><a href="ex/DateTime/subtract.html">subtract</a></span><span class="signature">(<wbr><span class="parameter" id="subtract-param-duration"><span class="type-annotation">Duration</span> <span class="parameter-name">duration</span></span>) |
| <span class="returntype parameter">→ <a href="ex/DateTime-class.html">DateTime</a></span> |
| </span> |
| </dt> |
| <dd> |
| <p>Returns a new <a href="ex/DateTime-class.html">DateTime</a> instance with <code>duration</code> subtracted from <code>this</code>.<a href="ex/DateTime/subtract.html">…</a> |
| </p> |
| </dd> |
| <dt id="toIso8601String" class="callable"> |
| <span class="name "><a href="ex/DateTime/toIso8601String.html">toIso8601String</a></span><span class="signature">(<wbr>) |
| <span class="returntype parameter">→ String</span> |
| </span> |
| </dt> |
| <dd> |
| <p>Returns an ISO-8601 full-precision extended format representation.<a href="ex/DateTime/toIso8601String.html">…</a> |
| </p> |
| </dd> |
| <dt id="toLocal" class="callable"> |
| <span class="name "><a href="ex/DateTime/toLocal.html">toLocal</a></span><span class="signature">(<wbr>) |
| <span class="returntype parameter">→ <a href="ex/DateTime-class.html">DateTime</a></span> |
| </span> |
| </dt> |
| <dd> |
| <p>Returns this DateTime value in the local time zone.<a href="ex/DateTime/toLocal.html">…</a> |
| </p> |
| </dd> |
| <dt id="toString" class="callable"> |
| <span class="name "><a href="ex/DateTime/toString.html">toString</a></span><span class="signature">(<wbr>) |
| <span class="returntype parameter">→ String</span> |
| </span> |
| </dt> |
| <dd> |
| <p>Returns a human-readable string for this instance.<a href="ex/DateTime/toString.html">…</a> |
| </p> |
| </dd> |
| <dt id="toUtc" class="callable"> |
| <span class="name "><a href="ex/DateTime/toUtc.html">toUtc</a></span><span class="signature">(<wbr>) |
| <span class="returntype parameter">→ <a href="ex/DateTime-class.html">DateTime</a></span> |
| </span> |
| </dt> |
| <dd> |
| <p>Returns this DateTime value in the UTC time zone.<a href="ex/DateTime/toUtc.html">…</a> |
| </p> |
| </dd> |
| </dl> |
| </section> |
| |
| </div> <!-- /.main-content --> |
| |
| <div class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right"> |
| <h5>DateTime</h5> |
| <ol> |
| <li class="section-title"><a href="ex/DateTime-class.html#constants">Constants</a></li> |
| <li><a href="ex/DateTime/APRIL.html">APRIL</a></li> |
| <li><a href="ex/DateTime/AUGUST.html">AUGUST</a></li> |
| <li><a href="ex/DateTime/DAYS_PER_WEEK.html">DAYS_PER_WEEK</a></li> |
| <li><a href="ex/DateTime/DECEMBER.html">DECEMBER</a></li> |
| <li><a href="ex/DateTime/FEBRUARY.html">FEBRUARY</a></li> |
| <li><a href="ex/DateTime/FRIDAY.html">FRIDAY</a></li> |
| <li><a href="ex/DateTime/JANUARY.html">JANUARY</a></li> |
| <li><a href="ex/DateTime/JULY.html">JULY</a></li> |
| <li><a href="ex/DateTime/JUNE.html">JUNE</a></li> |
| <li><a href="ex/DateTime/MARCH.html">MARCH</a></li> |
| <li><a href="ex/DateTime/MAY.html">MAY</a></li> |
| <li><a href="ex/DateTime/MONDAY.html">MONDAY</a></li> |
| <li><a href="ex/DateTime/MONTHS_PER_YEAR.html">MONTHS_PER_YEAR</a></li> |
| <li><a href="ex/DateTime/NOVEMBER.html">NOVEMBER</a></li> |
| <li><a href="ex/DateTime/OCTOBER.html">OCTOBER</a></li> |
| <li><a href="ex/DateTime/SATURDAY.html">SATURDAY</a></li> |
| <li><a href="ex/DateTime/SEPTEMBER.html">SEPTEMBER</a></li> |
| <li><a href="ex/DateTime/SUNDAY.html">SUNDAY</a></li> |
| <li><a href="ex/DateTime/THURSDAY.html">THURSDAY</a></li> |
| <li><a href="ex/DateTime/TUESDAY.html">TUESDAY</a></li> |
| <li><a href="ex/DateTime/WEDNESDAY.html">WEDNESDAY</a></li> |
| |
| |
| <li class="section-title"><a href="ex/DateTime-class.html#static-methods">Static methods</a></li> |
| <li><a href="ex/DateTime/parse.html">parse</a></li> |
| |
| <li class="section-title"><a href="ex/DateTime-class.html#constructors">Constructors</a></li> |
| <li><a href="ex/DateTime/DateTime.html">DateTime</a></li> |
| <li><a href="ex/DateTime/DateTime.fromMillisecondsSinceEpoch.html">fromMillisecondsSinceEpoch</a></li> |
| <li><a href="ex/DateTime/DateTime.now.html">now</a></li> |
| <li><a href="ex/DateTime/DateTime.utc.html">utc</a></li> |
| |
| <li class="section-title"> |
| <a href="ex/DateTime-class.html#instance-properties">Properties</a> |
| </li> |
| <li><a href="ex/DateTime/day.html">day</a></li> |
| <li><a href="ex/DateTime/hashCode.html">hashCode</a></li> |
| <li><a href="ex/DateTime/hour.html">hour</a></li> |
| <li><a href="ex/DateTime/isUtc.html">isUtc</a></li> |
| <li><a href="ex/DateTime/millisecond.html">millisecond</a></li> |
| <li><a href="ex/DateTime/millisecondsSinceEpoch.html">millisecondsSinceEpoch</a></li> |
| <li><a href="ex/DateTime/minute.html">minute</a></li> |
| <li><a href="ex/DateTime/month.html">month</a></li> |
| <li class="inherited"><a href="ex/DateTime/runtimeType.html">runtimeType</a></li> |
| <li><a href="ex/DateTime/second.html">second</a></li> |
| <li><a href="ex/DateTime/timeZoneName.html">timeZoneName</a></li> |
| <li><a href="ex/DateTime/timeZoneOffset.html">timeZoneOffset</a></li> |
| <li><a href="ex/DateTime/weekday.html">weekday</a></li> |
| <li><a href="ex/DateTime/year.html">year</a></li> |
| |
| <li class="section-title"><a href="ex/DateTime-class.html#operators">Operators</a></li> |
| <li><a href="ex/DateTime/operator_equals.html">operator ==</a></li> |
| |
| <li class="section-title"><a href="ex/DateTime-class.html#instance-methods">Methods</a></li> |
| <li><a href="ex/DateTime/add.html">add</a></li> |
| <li><a href="ex/DateTime/compareTo.html">compareTo</a></li> |
| <li><a href="ex/DateTime/difference.html">difference</a></li> |
| <li><a href="ex/DateTime/isAfter.html">isAfter</a></li> |
| <li><a href="ex/DateTime/isAtSameMomentAs.html">isAtSameMomentAs</a></li> |
| <li><a href="ex/DateTime/isBefore.html">isBefore</a></li> |
| <li class="inherited"><a href="ex/DateTime/noSuchMethod.html">noSuchMethod</a></li> |
| <li><a href="ex/DateTime/subtract.html">subtract</a></li> |
| <li><a href="ex/DateTime/toIso8601String.html">toIso8601String</a></li> |
| <li><a href="ex/DateTime/toLocal.html">toLocal</a></li> |
| <li><a href="ex/DateTime/toString.html">toString</a></li> |
| <li><a href="ex/DateTime/toUtc.html">toUtc</a></li> |
| </ol> |
| </div><!--/.sidebar-offcanvas--> |
| |
| </div> <!-- row --> |
| </div> <!-- container --> |
| |
| <footer> |
| <div class="container-fluid"> |
| <div class="container"> |
| <p class="text-center"> |
| <span class="no-break"> |
| test_package 0.0.1 |
| </span> |
| • |
| <span class="no-break"> |
| <a href="https://www.dartlang.org"> |
| <img src="static-assets/favicon.png" alt="Dart" title="Dart" width="16" height="16"> |
| </a> |
| </span> |
| • |
| <span class="copyright no-break"> |
| <a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a> |
| </span> |
| </p> |
| </div> |
| </div> |
| </footer> |
| |
| <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> |
| <script src="static-assets/typeahead.bundle.min.js"></script> |
| <script src="static-assets/prettify.js"></script> |
| <script src="static-assets/script.js"></script> |
| <!-- Do not remove placeholder --> |
| <!-- Footer Placeholder --> |
| |
| </body> |
| |
| </html> |