-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathclojure.instant-api.html
More file actions
243 lines (204 loc) · 12.6 KB
/
Copy pathclojure.instant-api.html
File metadata and controls
243 lines (204 loc) · 12.6 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>clojure.instant - Clojure v1.12.4 API documentation</title>
<link rel="icon" href="static/favicon.png" />
<link rel="shortcut icon" href="static/favicon.png" />
<link rel="stylesheet" href="static/clojure.css" type="text/css" media="all" />
<link rel="stylesheet" href="static/wiki.css" type="text/css" media="all" />
<link rel="stylesheet" href="static/internal.css" type="text/css" media="all" />
<style>.menuWrapper{height: 36px;}</style>
</head>
<!--
This document was auto-generated from the source by the clojure autodoc system.
To report errors or ask questions about the overall documentation structure, formatting,
etc., contact Tom Faulhaber (google mail name: tomfaulhaber).
For errors in the documentation of a particular namespace, contact the author of that
namespace.
-->
<body>
<div id="AllContentContainer">
<div id="Header">
<a href="index.html" id="Logo"><img src="static/clojure-icon.gif" width="100" height="100" alt="Clojure" /></a>
<h1><a href="index.html" id="page-header" title="page header title">Clojure Core API Reference</a></h1>
</div>
<div id="leftcolumn"><div style="text-align: center;"></div>
<div class="menu">
<div class="WikiCustomNav WikiElement wiki">
<span class="toc-header"><span id="project-name">Clojure</span> <span id="version">v1.12.4</span> API</span><br />
<ul>
<li><a href="index.html" class="wiki_link">Overview</a></li>
<li><a href="api-index.html" class="wiki_link">API Index</a></li>
</ul>
<div class="NamespaceTOC">
<span class="toc-header">Namespaces</span>
<ul id="left-sidebar-list">
<li><a class="wiki_link" href="clojure.core-api.html">clojure.core</a></li><li><a class="wiki_link" href="clojure.data-api.html">clojure.data</a></li><li><a class="wiki_link" href="clojure.datafy-api.html">clojure.datafy</a></li><li><a class="wiki_link" href="clojure.edn-api.html">clojure.edn</a></li><li><a class="wiki_link" href="clojure.inspector-api.html">clojure.inspector</a></li><li><a class="wiki_link" href="clojure.instant-api.html">clojure.instant</a></li><li><a class="wiki_link" href="clojure.java.basis-api.html">clojure.java.basis</a></li><li><a class="wiki_link" href="clojure.java.browse-api.html">clojure.java.browse</a></li><li><a class="wiki_link" href="clojure.java.io-api.html">clojure.java.io</a></li><li><a class="wiki_link" href="clojure.java.javadoc-api.html">clojure.java.javadoc</a></li><li><a class="wiki_link" href="clojure.java.process-api.html">clojure.java.process</a></li><li><a class="wiki_link" href="clojure.java.shell-api.html">clojure.java.shell</a></li><li><a class="wiki_link" href="clojure.main-api.html">clojure.main</a></li><li><a class="wiki_link" href="clojure.math-api.html">clojure.math</a></li><li><a class="wiki_link" href="clojure.pprint-api.html">clojure.pprint</a></li><li><a class="wiki_link" href="clojure.reflect-api.html">clojure.reflect</a></li><li><a class="wiki_link" href="clojure.repl-api.html">clojure.repl</a></li><li><a class="wiki_link" href="clojure.set-api.html">clojure.set</a></li><li><a class="wiki_link" href="clojure.stacktrace-api.html">clojure.stacktrace</a></li><li><a class="wiki_link" href="clojure.string-api.html">clojure.string</a></li><li><a class="wiki_link" href="clojure.template-api.html">clojure.template</a></li><li><a class="wiki_link" href="clojure.test-api.html">clojure.test</a></li><li><a class="wiki_link" href="clojure.tools.deps.interop-api.html">clojure.tools.deps.interop</a></li><li><a class="wiki_link" href="clojure.walk-api.html">clojure.walk</a></li><li><a class="wiki_link" href="clojure.xml-api.html">clojure.xml</a></li><li><a class="wiki_link" href="clojure.zip-api.html">clojure.zip</a></li>
</ul>
</div>
<div class="BranchTOC">
<span class="toc-header">Other Versions</span>
<ul id="left-sidebar-branch-list">
<li><a class="wiki_link" href="index.html">v1.12.3 (stable)</a></li><li><a class="wiki_link" href="branch-master/index.html">v1.13 (in development)</a></li><li><a class="wiki_link" href="branch-clojure-1.11.4/index.html">v1.11.4 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.10.3/index.html">v1.10.3 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.9.0/index.html">v1.9 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.8.0/index.html">v1.8 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.7.0/index.html">v1.7 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.6.0/index.html">v1.6 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.5.0/index.html">v1.5 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.4.0/index.html">v1.4 (legacy)</a></li><li><a class="wiki_link" href="branch-1.3.x/index.html">v1.3 (legacy)</a></li><li><a class="wiki_link" href="branch-1.2.x/index.html">v1.2 (legacy)</a></li><li><a class="wiki_link" href="branch-1.1.x/index.html">v1.1 (legacy)</a></li>
</ul>
</div>
<a class="wiki_link" href="https://clojure.org">Clojure Home</a>
</div>
</div>
</div>
<div id="rightcolumn">
<div id="Content">
<div class="contentBox"><div class="innerContentBox">
<div class="wiki wikiPage" id="content_view">
<div id="right-sidebar"><div id="toc">
<h1 class="nopad">Table of Contents</h1>
<div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#toc0">Overview</a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#var-section">Vars and Functions</a>
<div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.instant/parse-timestamp" class="toc-entry-anchor">parse-timestamp</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.instant/read-instant-calendar" class="toc-entry-anchor">read-instant-calendar</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.instant/read-instant-date" class="toc-entry-anchor">read-instant-date</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.instant/read-instant-timestamp" class="toc-entry-anchor">read-instant-timestamp</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.instant/validated" class="toc-entry-anchor">validated</a>
</div>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div>
</div>
</div>
<div id="content-tag"><h1 id="overview">API for <span id="clojure.instant">clojure.instant</span>
- <span id="header-project">Clojure</span> <span id="header-version">v1.12.4</span><span id="header-status-block"> (<span id="header-status">stable</span>)</span>
</h1>
<br />Full namespace name: <span id="long-name">clojure.instant</span>
<p></p>
<h2>Overview</h2>
<pre id="namespace-docstr"></pre>
<br />
<div id="var-section">
<p></p>
<h2>Public Variables and Functions</h2>
<div id="var-entry">
<br />
<hr />
<h2 id="clojure.instant/parse-timestamp">parse-timestamp</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (parse-timestamp new-instant cs)
</pre>
<pre id="var-docstr">Parse a string containing an RFC3339-like like timestamp.
The function new-instant is called with the following arguments.
min max default
--- ------------ -------
years 0 9999 N/A (s must provide years)
months 1 12 1
days 1 31 1 (actual max days depends
hours 0 23 0 on month and year)
minutes 0 59 0
seconds 0 60 0 (though 60 is only valid
nanoseconds 0 999999999 0 when minutes is 59)
offset-sign -1 1 0
offset-hours 0 23 0
offset-minutes 0 59 0
These are all integers and will be non-nil. (The listed defaults
will be passed if the corresponding field is not present in s.)
Grammar (of s):
date-fullyear = 4DIGIT
date-month = 2DIGIT ; 01-12
date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on
; month/year
time-hour = 2DIGIT ; 00-23
time-minute = 2DIGIT ; 00-59
time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second
; rules
time-secfrac = '.' 1*DIGIT
time-numoffset = ('+' / '-') time-hour ':' time-minute
time-offset = 'Z' / time-numoffset
time-part = time-hour [ ':' time-minute [ ':' time-second
[time-secfrac] [time-offset] ] ]
timestamp = date-year [ '-' date-month [ '-' date-mday
[ 'T' time-part ] ] ]
Unlike RFC3339:
- we only parse the timestamp format
- timestamp can elide trailing components
- time-offset is optional (defaults to +00:00)
Though time-offset is syntactically optional, a missing time-offset
will be treated as if the time-offset zero (+00:00) had been
specified.</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/ce1927e74b0c71c93375f1db2758d790a826f32c/src/clj/clojure/instant.clj#L53">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.instant/read-instant-calendar">read-instant-calendar</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (read-instant-calendar cs)
</pre>
<pre id="var-docstr">To read an instant as a java.util.Calendar, bind *data-readers* to a map with
this var as the value for the 'inst key. Calendar preserves the timezone
offset.</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/ce1927e74b0c71c93375f1db2758d790a826f32c/src/clj/clojure/instant.clj#L281">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.instant/read-instant-date">read-instant-date</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (read-instant-date cs)
</pre>
<pre id="var-docstr">To read an instant as a java.util.Date, bind *data-readers* to a map with
this var as the value for the 'inst key. The timezone offset will be used
to convert into UTC.</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/ce1927e74b0c71c93375f1db2758d790a826f32c/src/clj/clojure/instant.clj#L274">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.instant/read-instant-timestamp">read-instant-timestamp</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (read-instant-timestamp cs)
</pre>
<pre id="var-docstr">To read an instant as a java.sql.Timestamp, bind *data-readers* to a
map with this var as the value for the 'inst key. Timestamp preserves
fractional seconds with nanosecond precision. The timezone offset will
be used to convert into UTC.</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/ce1927e74b0c71c93375f1db2758d790a826f32c/src/clj/clojure/instant.clj#L288">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.instant/validated">validated</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (validated new-instance)
</pre>
<pre id="var-docstr">Return a function which constructs an instant by calling constructor
after first validating that those arguments are in range and otherwise
plausible. The resulting function will throw an exception if called
with invalid arguments.</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/ce1927e74b0c71c93375f1db2758d790a826f32c/src/clj/clojure/instant.clj#L139">Source</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="foot">
<div id="copyright" style="text-align: center;">Copyright 2007-2025 by Rich Hickey</div>
</div>
</div>
<div id="DesignedBy">Logo & site design by <a href="http://www.tomhickey.com" title="Visit Tom Hickey's website.">Tom Hickey</a>.<br />
Clojure auto-documentation system by Tom Faulhaber.</div>
</div>
<!-- /AllContentContainer -->
</body>
</html>