Debian Codegraph @

doc/html/topic-dates.html

raw
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
7 <title>Date Formats</title>
8 <link rel="stylesheet" href="../style.css" type="text/css" />
9 </head>
10 <body>
11 <div class="document" id="date-formats">
12 <span id="topic-dates"></span>
13 <h1 class="title">Date Formats</h1>
14
15 <p id="dates">Some commands allow the user to specify a date, e.g.:</p>
16 <ul class="simple">
17 <li>backout, commit, import, tag: Specify the commit date.</li>
18 <li>log, revert, update: Select revision(s) by date.</li>
19 </ul>
20 <p>Many date formats are valid. Here are some examples:</p>
21 <ul class="simple">
22 <li><tt class="docutils literal">Wed Dec 6 13:18:29 2006</tt> (local timezone assumed)</li>
23 <li><tt class="docutils literal">Dec 6 13:18 <span class="pre">-0600</span></tt> (year assumed, time offset provided)</li>
24 <li><tt class="docutils literal">Dec 6 13:18 UTC</tt> (UTC and GMT are aliases for +0000)</li>
25 <li><tt class="docutils literal">Dec 6</tt> (midnight)</li>
26 <li><tt class="docutils literal">13:18</tt> (today assumed)</li>
27 <li><tt class="docutils literal">3:39</tt> (3:39AM assumed)</li>
28 <li><tt class="docutils literal">3:39pm</tt> (15:39)</li>
29 <li><tt class="docutils literal"><span class="pre">2006-12-06</span> 13:18:29</tt> (ISO 8601 format)</li>
30 <li><tt class="docutils literal"><span class="pre">2006-12-6</span> 13:18</tt></li>
31 <li><tt class="docutils literal"><span class="pre">2006-12-6</span></tt></li>
32 <li><tt class="docutils literal"><span class="pre">12-6</span></tt></li>
33 <li><tt class="docutils literal">12/6</tt></li>
34 <li><tt class="docutils literal">12/6/6</tt> (Dec 6 2006)</li>
35 <li><tt class="docutils literal">today</tt> (midnight)</li>
36 <li><tt class="docutils literal">yesterday</tt> (midnight)</li>
37 <li><tt class="docutils literal">now</tt> - right now</li>
38 </ul>
39 <p>Lastly, there is Mercurial's internal format:</p>
40 <ul class="simple">
41 <li><tt class="docutils literal">1165411109 0</tt> (Wed Dec 6 13:18:29 2006 UTC)</li>
42 </ul>
43 <p>This is the internal representation format for dates. The first number
44 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
45 second is the offset of the local timezone, in seconds west of UTC
46 (negative if the timezone is east of UTC).</p>
47 <p>The log command also accepts date ranges:</p>
48 <ul class="simple">
49 <li><tt class="docutils literal">&lt;DATE</tt> - at or before a given date/time</li>
50 <li><tt class="docutils literal">&gt;DATE</tt> - on or after a given date/time</li>
51 <li><tt class="docutils literal">DATE to DATE</tt> - a date range, inclusive</li>
52 <li><tt class="docutils literal"><span class="pre">-DAYS</span></tt> - within a given number of days from today</li>
53 </ul>
54 </div>
55 </body>
56 </html>