blob: 30d9bfcdaa7b23f8289d146113d3cf7ba00558db [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class DateTools
| Apache Lucene.NET 4.8.0-beta00013 Documentation </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class DateTools
| Apache Lucene.NET 4.8.0-beta00013 Documentation ">
<meta name="generator" content="docfx 2.56.2.0">
<link rel="shortcut icon" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/logo/favicon.ico">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.vendor.css">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.css">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/main.css">
<meta property="docfx:navrel" content="toc.html">
<meta property="docfx:tocrel" content="core/toc.html">
<meta property="docfx:rel" content="https://lucenenet.apache.org/docs/4.8.0-beta00009/">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<span id="forkongithub"><a href="https://github.com/apache/lucenenet" target="_blank">Fork me on GitHub</a></span>
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
<img id="logo" class="svg" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/logo/lucene-net-color.png" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search">
<ul class="level0 breadcrumb">
<li>
<a href="https://lucenenet.apache.org/docs/4.8.0-beta00009/">API</a>
<span id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</span>
</li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list"></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Lucene.Net.Documents.DateTools">
<h1 id="Lucene_Net_Documents_DateTools" data-uid="Lucene.Net.Documents.DateTools" class="text-break">Class DateTools
</h1>
<div class="markdown level0 summary"><p>Provides support for converting dates to strings and vice-versa.
The strings are structured so that lexicographic sorting orders
them by date, which makes them suitable for use as field values
and search terms.</p>
<p><p>This class also helps you to limit the resolution of your dates. Do not
save dates with a finer resolution than you really need, as then
<a class="xref" href="Lucene.Net.Search.TermRangeQuery.html">TermRangeQuery</a> and <a class="xref" href="Lucene.Net.Search.PrefixQuery.html">PrefixQuery</a> will require more memory and become slower.</p>
<p><p>
Another approach is <a class="xref" href="Lucene.Net.Util.NumericUtils.html">NumericUtils</a>, which provides
a sortable binary representation (prefix encoded) of numeric values, which
date/time are.</p>
<p>For indexing a <span class="xref">System.DateTime</span>, just get the <span class="xref">System.DateTime.Ticks</span> and index
this as a numeric value with <a class="xref" href="Lucene.Net.Documents.Int64Field.html">Int64Field</a> and use <a class="xref" href="Lucene.Net.Search.NumericRangeQuery-1.html">NumericRangeQuery&lt;T&gt;</a>
to query it.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">DateTools</span></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<span class="xref">System.Object.Equals(System.Object)</span>
</div>
<div>
<span class="xref">System.Object.Equals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.GetHashCode()</span>
</div>
<div>
<span class="xref">System.Object.GetType()</span>
</div>
<div>
<span class="xref">System.Object.MemberwiseClone()</span>
</div>
<div>
<span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.ToString()</span>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Lucene.Net.Documents.html">Lucene.Net.Documents</a></h6>
<h6><strong>Assembly</strong>: Lucene.Net.dll</h6>
<h5 id="Lucene_Net_Documents_DateTools_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class DateTools</code></pre>
</div>
<h3 id="methods">Methods
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00013/websites/apidocs/apiSpec/new?filename=Lucene_Net_Documents_DateTools_DateToString_System_DateTime_Lucene_Net_Documents_DateTools_Resolution_.md&amp;value=---%0Auid%3A%20Lucene.Net.Documents.DateTools.DateToString(System.DateTime%2CLucene.Net.Documents.DateTools.Resolution)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/fix/apidocs-layout/src/Lucene.Net/Document/DateTools.cs/#L63">View Source</a>
</span>
<a id="Lucene_Net_Documents_DateTools_DateToString_" data-uid="Lucene.Net.Documents.DateTools.DateToString*"></a>
<h4 id="Lucene_Net_Documents_DateTools_DateToString_System_DateTime_Lucene_Net_Documents_DateTools_Resolution_" data-uid="Lucene.Net.Documents.DateTools.DateToString(System.DateTime,Lucene.Net.Documents.DateTools.Resolution)">DateToString(DateTime, DateTools.Resolution)</h4>
<div class="markdown level1 summary"><p>Converts a <span class="xref">System.DateTime</span> to a string suitable for indexing.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string DateToString(DateTime date, DateTools.Resolution resolution)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.DateTime</span></td>
<td><span class="parametername">date</span></td>
<td><p>the date to be converted </p>
</td>
</tr>
<tr>
<td><a class="xref" href="Lucene.Net.Documents.DateTools.Resolution.html">DateTools.Resolution</a></td>
<td><span class="parametername">resolution</span></td>
<td><p>the desired resolution, see
<a class="xref" href="Lucene.Net.Documents.DateTools.html#Lucene_Net_Documents_DateTools_Round_System_DateTime_Lucene_Net_Documents_DateTools_Resolution_">Round(DateTime, DateTools.Resolution)</a> </p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><p>a string in format <code>yyyyMMddHHmmssSSS</code> or shorter,
depending on <code data-dev-comment-type="paramref" class="paramref">resolution</code>; using GMT as timezone </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00013/websites/apidocs/apiSpec/new?filename=Lucene_Net_Documents_DateTools_Round_System_DateTime_Lucene_Net_Documents_DateTools_Resolution_.md&amp;value=---%0Auid%3A%20Lucene.Net.Documents.DateTools.Round(System.DateTime%2CLucene.Net.Documents.DateTools.Resolution)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/fix/apidocs-layout/src/Lucene.Net/Document/DateTools.cs/#L209">View Source</a>
</span>
<a id="Lucene_Net_Documents_DateTools_Round_" data-uid="Lucene.Net.Documents.DateTools.Round*"></a>
<h4 id="Lucene_Net_Documents_DateTools_Round_System_DateTime_Lucene_Net_Documents_DateTools_Resolution_" data-uid="Lucene.Net.Documents.DateTools.Round(System.DateTime,Lucene.Net.Documents.DateTools.Resolution)">Round(DateTime, DateTools.Resolution)</h4>
<div class="markdown level1 summary"><p>Limit a date&apos;s resolution. For example, the date <code>2004-09-21 13:50:11</code>
will be changed to <code>2004-09-01 00:00:00</code> when using
<a class="xref" href="Lucene.Net.Documents.DateTools.Resolution.html#Lucene_Net_Documents_DateTools_Resolution_MONTH">MONTH</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static DateTime Round(DateTime date, DateTools.Resolution resolution)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.DateTime</span></td>
<td><span class="parametername">date</span></td>
<td><p>the date to be rounded </p>
</td>
</tr>
<tr>
<td><a class="xref" href="Lucene.Net.Documents.DateTools.Resolution.html">DateTools.Resolution</a></td>
<td><span class="parametername">resolution</span></td>
<td><p>The desired resolution of the date to be returned </p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.DateTime</span></td>
<td><p>the date with all values more precise than <code data-dev-comment-type="paramref" class="paramref">resolution</code>
set to 0 or 1 </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00013/websites/apidocs/apiSpec/new?filename=Lucene_Net_Documents_DateTools_Round_System_Int64_Lucene_Net_Documents_DateTools_Resolution_.md&amp;value=---%0Auid%3A%20Lucene.Net.Documents.DateTools.Round(System.Int64%2CLucene.Net.Documents.DateTools.Resolution)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/fix/apidocs-layout/src/Lucene.Net/Document/DateTools.cs/#L225">View Source</a>
</span>
<a id="Lucene_Net_Documents_DateTools_Round_" data-uid="Lucene.Net.Documents.DateTools.Round*"></a>
<h4 id="Lucene_Net_Documents_DateTools_Round_System_Int64_Lucene_Net_Documents_DateTools_Resolution_" data-uid="Lucene.Net.Documents.DateTools.Round(System.Int64,Lucene.Net.Documents.DateTools.Resolution)">Round(Int64, DateTools.Resolution)</h4>
<div class="markdown level1 summary"><p>Limit a date&apos;s resolution. For example, the date <code>1095767411000</code>
(which represents 2004-09-21 13:50:11) will be changed to
<code>1093989600000</code> (2004-09-01 00:00:00) when using
<a class="xref" href="Lucene.Net.Documents.DateTools.Resolution.html#Lucene_Net_Documents_DateTools_Resolution_MONTH">MONTH</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static long Round(long time, DateTools.Resolution resolution)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int64</span></td>
<td><span class="parametername">time</span></td>
<td><p>the time to be rounded </p>
</td>
</tr>
<tr>
<td><a class="xref" href="Lucene.Net.Documents.DateTools.Resolution.html">DateTools.Resolution</a></td>
<td><span class="parametername">resolution</span></td>
<td><p>The desired resolution of the date to be returned </p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int64</span></td>
<td><p>the date with all values more precise than <code data-dev-comment-type="paramref" class="paramref">resolution</code>
set to 0 or 1, expressed as milliseconds since January 1, 1970, 00:00:00 GMT
(also known as the &quot;epoch&quot;)</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00013/websites/apidocs/apiSpec/new?filename=Lucene_Net_Documents_DateTools_StringToDate_System_String_.md&amp;value=---%0Auid%3A%20Lucene.Net.Documents.DateTools.StringToDate(System.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/fix/apidocs-layout/src/Lucene.Net/Document/DateTools.cs/#L135">View Source</a>
</span>
<a id="Lucene_Net_Documents_DateTools_StringToDate_" data-uid="Lucene.Net.Documents.DateTools.StringToDate*"></a>
<h4 id="Lucene_Net_Documents_DateTools_StringToDate_System_String_" data-uid="Lucene.Net.Documents.DateTools.StringToDate(System.String)">StringToDate(String)</h4>
<div class="markdown level1 summary"><p>Converts a string produced by <a class="xref" href="Lucene.Net.Documents.DateTools.html#Lucene_Net_Documents_DateTools_TimeToString_System_Int64_Lucene_Net_Documents_DateTools_Resolution_">TimeToString(Int64, DateTools.Resolution)</a> or
<a class="xref" href="Lucene.Net.Documents.DateTools.html#Lucene_Net_Documents_DateTools_DateToString_System_DateTime_Lucene_Net_Documents_DateTools_Resolution_">DateToString(DateTime, DateTools.Resolution)</a> back to a time, represented as a
<span class="xref">System.DateTime</span> object.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static DateTime StringToDate(string dateString)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">dateString</span></td>
<td><p>the date string to be converted </p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.DateTime</span></td>
<td><p>the parsed time as a <span class="xref">System.DateTime</span> object </p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.FormatException</span></td>
<td><p>if <code data-dev-comment-type="paramref" class="paramref">dateString</code> is not in the
expected format </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00013/websites/apidocs/apiSpec/new?filename=Lucene_Net_Documents_DateTools_StringToTime_System_String_.md&amp;value=---%0Auid%3A%20Lucene.Net.Documents.DateTools.StringToTime(System.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/fix/apidocs-layout/src/Lucene.Net/Document/DateTools.cs/#L121">View Source</a>
</span>
<a id="Lucene_Net_Documents_DateTools_StringToTime_" data-uid="Lucene.Net.Documents.DateTools.StringToTime*"></a>
<h4 id="Lucene_Net_Documents_DateTools_StringToTime_System_String_" data-uid="Lucene.Net.Documents.DateTools.StringToTime(System.String)">StringToTime(String)</h4>
<div class="markdown level1 summary"><p>Converts a string produced by <a class="xref" href="Lucene.Net.Documents.DateTools.html#Lucene_Net_Documents_DateTools_TimeToString_System_Int64_Lucene_Net_Documents_DateTools_Resolution_">TimeToString(Int64, DateTools.Resolution)</a> or
<a class="xref" href="Lucene.Net.Documents.DateTools.html#Lucene_Net_Documents_DateTools_DateToString_System_DateTime_Lucene_Net_Documents_DateTools_Resolution_">DateToString(DateTime, DateTools.Resolution)</a> back to a time, represented as the
number of milliseconds since January 1, 1970, 00:00:00 GMT (also known as the &quot;epoch&quot;).</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static long StringToTime(string dateString)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">dateString</span></td>
<td><p>the date string to be converted </p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int64</span></td>
<td><p>the number of milliseconds since January 1, 1970, 00:00:00 GMT (also known as the &quot;epoch&quot;)</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.FormatException</span></td>
<td><p>if <code data-dev-comment-type="paramref" class="paramref">dateString</code> is not in the
expected format </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00013/websites/apidocs/apiSpec/new?filename=Lucene_Net_Documents_DateTools_TimeToString_System_Int64_Lucene_Net_Documents_DateTools_Resolution_.md&amp;value=---%0Auid%3A%20Lucene.Net.Documents.DateTools.TimeToString(System.Int64%2CLucene.Net.Documents.DateTools.Resolution)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/fix/apidocs-layout/src/Lucene.Net/Document/DateTools.cs/#L76">View Source</a>
</span>
<a id="Lucene_Net_Documents_DateTools_TimeToString_" data-uid="Lucene.Net.Documents.DateTools.TimeToString*"></a>
<h4 id="Lucene_Net_Documents_DateTools_TimeToString_System_Int64_Lucene_Net_Documents_DateTools_Resolution_" data-uid="Lucene.Net.Documents.DateTools.TimeToString(System.Int64,Lucene.Net.Documents.DateTools.Resolution)">TimeToString(Int64, DateTools.Resolution)</h4>
<div class="markdown level1 summary"><p>Converts a millisecond time to a string suitable for indexing.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string TimeToString(long time, DateTools.Resolution resolution)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int64</span></td>
<td><span class="parametername">time</span></td>
<td><p>the date expressed as milliseconds since January 1, 1970, 00:00:00 GMT (also known as the &quot;epoch&quot;) </p>
</td>
</tr>
<tr>
<td><a class="xref" href="Lucene.Net.Documents.DateTools.Resolution.html">DateTools.Resolution</a></td>
<td><span class="parametername">resolution</span></td>
<td><p>the desired resolution, see
<a class="xref" href="Lucene.Net.Documents.DateTools.html#Lucene_Net_Documents_DateTools_Round_System_Int64_Lucene_Net_Documents_DateTools_Resolution_">Round(Int64, DateTools.Resolution)</a> </p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><p>a string in format <code>yyyyMMddHHmmssSSS</code> or shorter,
depending on <code data-dev-comment-type="paramref" class="paramref">resolution</code>; using GMT as timezone </p>
</td>
</tr>
</tbody>
</table>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00013/websites/apidocs/apiSpec/new?filename=Lucene_Net_Documents_DateTools.md&amp;value=---%0Auid%3A%20Lucene.Net.Documents.DateTools%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
</li>
<li>
<a href="https://github.com/apache/lucenenet/blob/fix/apidocs-layout/src/Lucene.Net/Document/DateTools.cs/#L42" class="contribution-link">View Source</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
Copyright © 2020 The Apache Software Foundation, Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache License, Version 2.0</a><br> <small>Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation. <br>All other marks mentioned may be trademarks or registered trademarks of their respective owners.</small>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.vendor.js"></script>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.js"></script>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/main.js"></script>
</body>
</html>