File: topic-dates.html

package info (click to toggle)
mercurial 7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 46,124 kB
  • sloc: python: 214,491; ansic: 56,606; tcl: 3,715; sh: 1,879; lisp: 1,483; cpp: 864; makefile: 792; javascript: 649; xml: 36
file content (56 lines) | stat: -rw-r--r-- 2,993 bytes parent folder | download | duplicates (3)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
<title>Date Formats</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<body>
<div class="document" id="date-formats">
<span id="topic-dates"></span>
<h1 class="title">Date Formats</h1>

<p id="dates">Some commands allow the user to specify a date, e.g.:</p>
<ul class="simple">
<li>backout, commit, import, tag: Specify the commit date.</li>
<li>log, revert, update: Select revision(s) by date.</li>
</ul>
<p>Many date formats are valid. Here are some examples:</p>
<ul class="simple">
<li><tt class="docutils literal">Wed Dec 6 13:18:29 2006</tt> (local timezone assumed)</li>
<li><tt class="docutils literal">Dec 6 13:18 <span class="pre">-0600</span></tt> (year assumed, time offset provided)</li>
<li><tt class="docutils literal">Dec 6 13:18 UTC</tt> (UTC and GMT are aliases for +0000)</li>
<li><tt class="docutils literal">Dec 6</tt> (midnight)</li>
<li><tt class="docutils literal">13:18</tt> (today assumed)</li>
<li><tt class="docutils literal">3:39</tt> (3:39AM assumed)</li>
<li><tt class="docutils literal">3:39pm</tt> (15:39)</li>
<li><tt class="docutils literal"><span class="pre">2006-12-06</span> 13:18:29</tt> (ISO 8601 format)</li>
<li><tt class="docutils literal"><span class="pre">2006-12-6</span> 13:18</tt></li>
<li><tt class="docutils literal"><span class="pre">2006-12-6</span></tt></li>
<li><tt class="docutils literal"><span class="pre">12-6</span></tt></li>
<li><tt class="docutils literal">12/6</tt></li>
<li><tt class="docutils literal">12/6/6</tt> (Dec 6 2006)</li>
<li><tt class="docutils literal">today</tt> (midnight)</li>
<li><tt class="docutils literal">yesterday</tt> (midnight)</li>
<li><tt class="docutils literal">now</tt> - right now</li>
</ul>
<p>Lastly, there is Mercurial's internal format:</p>
<ul class="simple">
<li><tt class="docutils literal">1165411109 0</tt> (Wed Dec 6 13:18:29 2006 UTC)</li>
</ul>
<p>This is the internal representation format for dates. The first number
is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
second is the offset of the local timezone, in seconds west of UTC
(negative if the timezone is east of UTC).</p>
<p>The log command also accepts date ranges:</p>
<ul class="simple">
<li><tt class="docutils literal">&lt;DATE</tt> - at or before a given date/time</li>
<li><tt class="docutils literal">&gt;DATE</tt> - on or after a given date/time</li>
<li><tt class="docutils literal">DATE to DATE</tt> - a date range, inclusive</li>
<li><tt class="docutils literal"><span class="pre">-DAYS</span></tt> - within a given number of days from today</li>
</ul>
</div>
</body>
</html>