-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathapi.clj
More file actions
711 lines (595 loc) · 40.6 KB
/
api.clj
File metadata and controls
711 lines (595 loc) · 40.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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
;; NOTE: This namespace is generated by java-time.dev.gen
(ns ^{:supercedes "java-time"} java-time.api (:refer-clojure :exclude (zero? range iterate max min contains? format abs < > <= >= = * - + neg?)) (:require [java-time core properties temporal amount zone single-field local chrono convert sugar seqs adjuster interval format joda clock pre-java8 mock]))
(defmacro ^{:doc "Executes the given `forms` in the scope of the provided `clock`.
All the temporal entities that get created without parameters will inherit
their values from the clock:
(with-clock (system-clock \"Europe/London\")
(zone-id))
=> #<java.time.ZoneRegion Europe/London>"} with-clock [c & forms] (list* (quote java-time.clock/with-clock) c forms))
(defmacro ^{:doc "Execute the `body` when Joda-Time classes are found on the classpath.
Take care - when AOT-compiling code using this macro, the Joda-Time classes
must be on the classpath at compile time!"} when-joda-time-loaded [& body] (list* (quote java-time.util/when-joda-time-loaded) body))
(def ^{:arglists (quote ([^Clock c f])), :doc "Executes the given function in the scope of the provided clock. All the
temporal entities that get created without parameters will inherit their
values from the clock."} with-clock-fn java-time.clock/with-clock-fn)
(defn ^{:doc "True if the amount is zero"} zero? ([a] (java-time.core/zero? a)))
(defn ^{:doc "True if the amount is negative"} negative? ([a] (java-time.core/negative? a)))
(defn ^{:doc "Negates a temporal amount:
(negate (negate x)) == x"} negate ([a] (java-time.core/negate a)))
(defn ^{:doc "Returns the absolute value of a temporal amount:
(abs (negate x)) == (abs x)"} abs ([a] (java-time.core/abs a)))
(def ^{:arglists (quote ([o & os])), :doc "Latest/longest of the given time entities. Entities should be of the same
type"} max java-time.core/max)
(def ^{:arglists (quote ([o & os])), :doc "Earliest/shortest of the given time entities. Entities should be of the same
type"} min java-time.core/min)
(def ^{:arglists (quote ([x] [x y] [x y & more])), :doc "Returns `true` if time entities are ordered from the earliest to the
latest (same semantics as `<`), otherwise `false`.
```
(before? (local-date 2009) (local-date 2010) (local-date 2011))
=> true
(before? (interval (instant 10000) (instant 1000000))
(instant 99999999))
=> true
```"} before? java-time.core/before?)
(def ^{:arglists (quote ([x] [x y] [x y & more])), :doc "Returns `true` if time entities are ordered from the earliest to the
latest (same semantics as `<=`), otherwise `false`.
```
(not-after? (local-date 2009) (local-date 2010) (local-date 2011))
;=> true
(not-after? (interval (instant 10000) (instant 1000000))
(instant 99999999))
;=> true
```"} not-after? java-time.core/not-after?)
(def ^{:arglists (quote ([x] [x y] [x y & more])), :doc "Returns `true` if time entities are ordered from the latest to the
earliest (same semantics as `>`), otherwise `false`.
```
(after? (local-date 2011) (local-date 2010) (local-date 2009))
=> true
(after? (instant 99999999)
(interval (instant 10000) (instant 1000000)))
=> true
```"} after? java-time.core/after?)
(def ^{:arglists (quote ([x] [x y] [x y & more])), :doc "Returns `true` if time entities are ordered from the latest to the
earliest (same semantics as `>=`), otherwise `false`.
```
(not-before? (local-date 2011) (local-date 2010) (local-date 2009))
;=> true
(not-before? (instant 99999999)
(interval (instant 10000) (instant 1000000)))
;=> true
```"} not-before? java-time.core/not-before?)
(defn ^{:doc "True if the `o` entity supports the `p` property"} supports? ([o p] (java-time.core/supports? o p)))
(defn ^{:doc "Fields present in this temporal entity"} fields ([o] (java-time.core/fields o)))
(defn ^{:doc "Units present in this temporal entity."} units ([o] (java-time.core/units o)))
(defn ^{:doc "Map of properties present in this temporal entity"} properties ([o] (java-time.core/properties o)))
(defn ^{:doc "Property of this temporal entity under key `k`"} property ([o k] (java-time.core/property o k)))
(def ^{:arglists (quote ([o k] [o k1 k2] [o k1 k2 & ks])), :doc "Values of property/unit identified by keys/objects `ks` of the temporal
entity `o`, e.g.
```
(as (duration 1 :hours) :minutes)
=> 60
(as (local-date 2015 9) :year :month-of-year)
=> [2015 9]
```"} as java-time.core/as)
(defn ^{:doc "Value of the property"} value ([p] (java-time.core/value p)))
(defn ^{:doc "Range of values for this property"} range ([p] (java-time.core/range p)))
(defn ^{:doc "Minimum value of this property"} min-value ([p] (java-time.core/min-value p)))
(defn ^{:doc "Maximum value of this property, e.g. 29th of February for months"} max-value ([p] (java-time.core/max-value p)))
(defn ^{:doc "Largest minimum value of this property"} largest-min-value ([p] (java-time.core/largest-min-value p)))
(defn ^{:doc "Smallest maximum value of this property, e.g. 28th of February for months"} smallest-max-value ([p] (java-time.core/smallest-max-value p)))
(defn ^{:doc "Truncates this entity to the specified time unit. Only works for units that
divide into the length of standard day without remainder (up to `:days`)."} truncate-to ([o u] (java-time.core/truncate-to o u)))
(defn ^{:doc "Time between temporal entities `o` and `e` in unit `u`.
```
(j/time-between (j/local-date 2015) (j/local-date 2016) :days)
=> 365
(j/time-between :days (j/local-date 2015) (j/local-date 2016))
=> 365
```"} time-between ([o e u] (java-time.core/time-between o e u)))
(defn ^{:doc "Returns this temporal entity with the specified `ZoneId`"} with-zone ([o z] (java-time.core/with-zone o z)))
(def ^{:arglists (quote ([o & os])), :doc "Adds all of the `os` to the time entity `o`. `plus` is not commutative, the
first argument is always the entity which will accumulate the rest of the
arguments.
```
(j/plus (j/local-date 2015) (j/years 1))
=> <java.time.LocalDate \"2016-01-01\">
```"} plus java-time.core/plus)
(def ^{:arglists (quote ([o & os])), :doc "Subtracts all of the `os` from the time entity `o`
```
(j/minus (j/local-date 2015) (j/years 1))
=> <java.time.LocalDate \"2014-01-01\">
```"} minus java-time.core/minus)
(defn ^{:doc "Entity `o` multiplied by the value `v`"} multiply-by ([o v] (java-time.core/multiply-by o v)))
(def ^{:arglists (quote ([x] [x y] [x y & more])), :doc "Returns `true` if time entities are ordered from the earliest to the
latest (same semantics as `<`), otherwise `false`.
```
(j/< (local-date 2009) (local-date 2010) (local-date 2011))
=> true
(j/< (interval (instant 10000) (instant 1000000))
(instant 99999999))
=> true
```"} < java-time.core/<)
(def ^{:arglists (quote ([x] [x y] [x y & more])), :doc "Returns `true` if time entities are ordered from the latest to the
earliest (same semantics as `>`), otherwise `false`.
```
(j/> (local-date 2011) (local-date 2010) (local-date 2009))
=> true
(j/> (instant 99999999)
(interval (instant 10000) (instant 1000000)))
=> true
```"} > java-time.core/>)
(def ^{:arglists (quote ([x] [x y] [x y & more])), :doc "Returns `true` if time entities are ordered from the earliest to the
latest (same semantics as `<=`), otherwise `false`.
```
(j/<= (local-date 2009) (local-date 2010) (local-date 2011))
;=> true
(j/<= (interval (instant 10000) (instant 1000000))
(instant 99999999))
;=> true
```"} <= java-time.core/<=)
(def ^{:arglists (quote ([x] [x y] [x y & more])), :doc "Returns `true` if time entities are ordered from the latest to the
earliest (same semantics as `>=`), otherwise `false`.
```
(j/>= (local-date 2011) (local-date 2010) (local-date 2009))
;=> true
(j/>= (instant 99999999)
(interval (instant 10000) (instant 1000000)))
;=> true
```"} >= java-time.core/>=)
(def ^{:arglists (quote ([o v])), :doc "Entity `o` multiplied by the value `v`"} * java-time.core/*)
(def ^{:arglists (quote ([o & os])), :doc "Subtracts all of the `os` from the time entity `o`
```
(j/- (j/local-date 2015) (j/years 1))
=> <java.time.LocalDate \"2014-01-01\">
```"} - java-time.core/-)
(def ^{:arglists (quote ([o & os])), :doc "Adds all of the `os` to the time entity `o`. `+` is not commutative, the
first argument is always the entity which will accumulate the rest of the
arguments.
```
(j/+ (j/local-date 2015) (j/years 1))
=> <java.time.LocalDate \"2016-01-01\">
```"} + java-time.core/+)
(def ^{:arglists (quote ([x] [x y] [x y & more])), :doc "Returns true if all time entities represent the same time, otherwise false.
`j/=` is not commutative, the first argument is always the entity which will
accumulate the rest of the arguments.
e.g., (j/= (j/day-of-week :thursday) :thursday) => true"} = java-time.core/=)
(defn ^{:doc "The `Chronology` of the entity", :tag java.time.chrono.Chronology} chronology ([o] (java-time.core/chronology o)))
(defn ^{:doc "True if the year of this entity is a leap year."} leap? ([o] (java-time.core/leap? o)))
(defn ^{:doc "Underlying temporal entity with the value of this property set to `v`"} with-value ([p v] (java-time.core/with-value p v)))
(defn ^{:doc "Underlying temporal entity with the value set to the minimum available for
this property"} with-min-value ([p] (java-time.core/with-min-value p)))
(defn ^{:doc "Underlying temporal entity with the value set to the maximum
available for this property"} with-max-value ([p] (java-time.core/with-max-value p)))
(defn ^{:doc "Underlying temporal entity with the value set to the largest minimum
available for this property"} with-largest-min-value ([p] (java-time.core/with-largest-min-value p)))
(defn ^{:doc "Underlying temporal entity with the value set to the smallest maximum
available for this property"} with-smallest-max-value ([p] (java-time.core/with-smallest-max-value p)))
(def ^{:arglists (quote ([] [arg0] [arg0 arg1])), :doc "Creates a duration - a temporal entity representing standard days, hours,
minutes, millis, micros and nanos. The duration itself contains only seconds
and nanos as properties.
Given one argument will:
* interpret as millis if a number
* try to parse from the standard format if a string
* extract supported units from another `TemporalAmount`
* convert from a Joda Period/Duration
Given two arguments will:
* get a duration between two `Temporal`s
* get a duration of a specified unit, e.g. `(duration 100 :seconds)`", :tag java.time.Duration} duration java-time.amount/duration)
(def ^{:arglists (quote ([] [arg0] [arg0 arg1] [arg0 arg1 arg2])), :doc "Creates a period - a temporal entity consisting of years, months and days.
Given one argument will
* interpret as years if a number
* try to parse from the standard format if a string
* extract supported units from another `TemporalAmount`
* convert from a Joda Period
Given two arguments will
* get a period of a specified unit, e.g. `(period 10 :months)`
* get a period between two temporals by converting them to local dates
* get a period of a specified number of years and months
Given three arguments will create a year/month/day period.", :tag java.time.Period} period java-time.amount/period)
(def ^{:arglists (quote ([v])), :doc "Returns true if `v` is an instance of java.time.Period, otherwise false."} period? java-time.amount/period?)
(def ^{:arglists (quote ([v])), :doc "Returns true if `v` is an instance of java.time.Duration, otherwise false."} duration? java-time.amount/duration?)
(def ^{:arglists (quote ([i])), :doc "Returns a `Duration` of `i` nanos.", :tag java.time.Duration} nanos java-time.amount/nanos)
(def ^{:arglists (quote ([micros])), :doc "Duration of a specified number of microseconds.", :tag java.time.Duration} micros java-time.amount/micros)
(def ^{:arglists (quote ([i])), :doc "Returns a `Duration` of `i` millis.", :tag java.time.Duration} millis java-time.amount/millis)
(def ^{:arglists (quote ([i])), :doc "Returns a `Duration` of `i` seconds.", :tag java.time.Duration} seconds java-time.amount/seconds)
(def ^{:arglists (quote ([i])), :doc "Returns a `Duration` of `i` minutes.", :tag java.time.Duration} minutes java-time.amount/minutes)
(def ^{:arglists (quote ([i])), :doc "Returns a `Duration` of `i` hours.", :tag java.time.Duration} hours java-time.amount/hours)
(def ^{:arglists (quote ([i])), :doc "Returns a `Duration` of `i` days.", :tag java.time.Duration} standard-days java-time.amount/standard-days)
(def ^{:arglists (quote ([i])), :doc "Returns a `Period` of `i` days.", :tag java.time.Period} days java-time.amount/days)
(def ^{:arglists (quote ([i])), :doc "Returns a `Period` of `i` weeks.", :tag java.time.Period} weeks java-time.amount/weeks)
(def ^{:arglists (quote ([i])), :doc "Returns a `Period` of `i` months.", :tag java.time.Period} months java-time.amount/months)
(def ^{:arglists (quote ([i])), :doc "Returns a `Period` of `i` years.", :tag java.time.Period} years java-time.amount/years)
(def ^{:arglists (quote ([o])), :doc "True if this is a `TemporalUnit`."} unit? java-time.properties/unit?)
(def ^{:arglists (quote ([k] [entity k])), :doc "Returns a `TemporalUnit` for the given key `k` or extracts the field from
the given temporal `entity`.
You can see predefined units via [[java-time.repl/show-units]].
If you want to make your own custom TemporalUnits resolvable, you need to rebind the
`java-time.properties/*units*` to a custom `java_time.properties.UnitGroup`.", :tag java.time.temporal.TemporalUnit} unit java-time.properties/unit)
(def ^{:arglists (quote ([o])), :doc "True if this is a `TemporalField`."} field? java-time.properties/field?)
(def ^{:arglists (quote ([k] [entity k])), :doc "Returns a `TemporalField` for the given key `k` or extracts the field from
the given temporal `entity`.
You can see predefined fields via [[java-time.repl/show-fields]].
If you want to make your own custom TemporalFields resolvable, you need to rebind the
`java-time.properties/*fields*` to a custom `java_time.properties.FieldGroup`.", :tag java.time.temporal.TemporalUnit} field java-time.properties/field)
(def ^{:arglists (quote ([min max] [arg0])), :doc "Creates a `ValueRange` given the `min` and `max` amounts or a map of
`:min-smallest`, `:max-smallest`, `:min-largest` and `:max-largest`.", :tag java.time.temporal.ValueRange} value-range java-time.temporal/value-range)
(def ^{:arglists (quote ([] [arg0] [arg0 arg1])), :doc "Creates an `Instant`. The following arguments are supported:
* no arguments - current instant
* one argument
+ clock
+ java.util.Date/Calendar
+ another temporal entity
+ string representation
+ millis from epoch
* two arguments
+ formatter (format) and a string", :tag java.time.Instant} instant java-time.temporal/instant)
(def ^{:arglists (quote ([v])), :doc "Returns true if `v` is an instance of java.time.Instant, otherwise false."} instant? java-time.temporal/instant?)
(def ^{:arglists (quote ([] [arg0] [arg0 arg1] [arg0 arg1 arg2])), :doc "Creates a `LocalDate`. The following arguments are supported:
* no arguments - current local-date
* one argument
+ clock
+ another temporal entity
+ string representation
+ year
* two arguments
+ formatter (format) and a string
+ an instant and a zone id
+ another temporal entity and an offset (preserves local time)
+ year and month
* three arguments
+ year, month and date", :tag java.time.LocalDate} local-date java-time.local/local-date)
(def ^{:arglists (quote ([] [y m d h] [y m d h mm] [y m d h mm ss] [y m d h mm ss n] [arg0] [arg0 arg1] [arg0 arg1 arg2])), :doc "Creates a `LocalDateTime`. The following arguments are supported:
* no arguments - current local date-time
* one argument
+ clock
+ another temporal entity
+ string representation
+ year
* two arguments
+ local date and local time
+ an instant and a zone id
+ formatter (format) and a string
+ year and month
* three and more arguments - year/month/day/...", :tag java.time.LocalDateTime} local-date-time java-time.local/local-date-time)
(def ^{:arglists (quote ([] [h m s nn] [arg0] [arg0 arg1] [arg0 arg1 arg2])), :doc "Creates a `LocalTime`. The following arguments are supported:
* no arguments - current local time
* one argument
+ clock
+ another temporal entity
+ string representation
+ hours
* two arguments
+ formatter (format) and a string
+ an instant and a zone id
+ hours and minutes
* three/four arguments - hour, minute, second, nanos", :tag java.time.LocalTime} local-time java-time.local/local-time)
(def ^{:arglists (quote ([v])), :doc "Returns true if `v` is an instance of java.time.LocalDate, otherwise false."} local-date? java-time.local/local-date?)
(def ^{:arglists (quote ([v])), :doc "Returns true if `v` is an instance of java.time.LocalDateTime, otherwise false."} local-date-time? java-time.local/local-date-time?)
(def ^{:arglists (quote ([v])), :doc "Returns true if `v` is an instance of java.time.LocalTime, otherwise false."} local-time? java-time.local/local-time?)
(def ^{:arglists (quote ([] [arg] [fmt arg])), :doc "Returns the `Year` for the given entity, string, clock, zone or number.
Current year if no arguments given.", :tag java.time.Year} year java-time.single-field/year)
(def ^{:arglists (quote ([o])), :doc "Returns true if `o` is `java.time.Year`, otherwise false."} year? java-time.single-field/year?)
(def ^{:arglists (quote ([] [v] [fmt arg])), :doc "Returns the `Month` for the given month keyword name (e.g. `:january`),
ordinal or entity. Current month if no arguments given.", :tag java.time.Month} month java-time.single-field/month)
(def ^{:arglists (quote ([o])), :doc "True if `java.time.Month`."} month? java-time.single-field/month?)
(def ^{:arglists (quote ([] [v] [fmt arg])), :doc "Returns the `DayOfWeek` for the given day keyword name (e.g. `:monday`),
ordinal or entity. Current day if no arguments given.", :tag java.time.DayOfWeek} day-of-week java-time.single-field/day-of-week)
(def ^{:arglists (quote ([o])), :doc "True if `java.time.DayOfWeek`."} day-of-week? java-time.single-field/day-of-week?)
(def ^{:arglists (quote ([] [arg] [a b])), :doc "Returns the `MonthDay` for the given entity, string, clock, zone or
month/day combination. Current month-day if no arguments given.", :tag java.time.MonthDay} month-day java-time.single-field/month-day)
(def ^{:arglists (quote ([o])), :doc "Returns true if `o` is `java.time.MonthDay`, otherwise false."} month-day? java-time.single-field/month-day?)
(def ^{:arglists (quote ([] [arg] [a b])), :doc "Returns the `YearMonth` for the given entity, string, clock, zone or
month/day combination. Current year-month if no arguments given.", :tag java.time.YearMonth} year-month java-time.single-field/year-month)
(def ^{:arglists (quote ([o])), :doc "Returns true if `o` is `java.time.YearMonth`, otherwise false."} year-month? java-time.single-field/year-month?)
(def ^{:arglists (quote ([])), :doc "Returns a set of string identifiers for all available ZoneIds."} available-zone-ids java-time.zone/available-zone-ids)
(def ^{:arglists (quote ([] [arg0] [arg0 arg1])), :doc "Creates a `ZoneId` from a string identifier, `java.util.TimeZone` or extracts
from another temporal entity.
Returns default system zone id if no arguments provided.
Given two arguments will use the second as the offset.", :tag java.time.ZoneId} zone-id java-time.zone/zone-id)
(def ^{:arglists (quote ([] [o] [h m] [h m s])), :doc "Creates a `ZoneOffset` from a string identifier (e.g. \"+01\"), a number of
hours/hours and minutes/hours, minutes and seconds or extracts from another
temporal entity.
Returns default system zone offset if no arguments provided.", :tag java.time.ZoneOffset} zone-offset java-time.zone/zone-offset)
(def ^{:arglists (quote ([] [y m d h] [y mo d h m] [y mo d h m s] [y mo d h m s n] [y mo d h m s n o] [arg0] [arg0 arg1] [arg0 arg1 arg2])), :doc "Creates an `OffsetDateTime`. The following arguments are supported:
* no arguments - current date-time with the default offset
* one argument
+ clock
+ zone offset
+ another temporal entity
+ string representation
+ year
* two arguments
+ formatter (format) and a string
+ local date-time and an offset
+ another temporal entity and an offset (preserves local time)
+ year and month
* three arguments
+ local date, local time and an offset
+ year, month and date
* four up to seven arguments - position date-time constructors
* eight arguments - time fields up to nanoseconds and a zone offset
If zone offset is not specified, default will be used. You can check the
default offset by invoking `(zone-offset)`.", :tag java.time.OffsetDateTime} offset-date-time java-time.zone/offset-date-time)
(def ^{:arglists (quote ([] [h m s] [h m s n] [h m s n o] [arg0] [arg0 arg1])), :doc "Creates an `OffsetTime`. The following arguments are supported:
* no arguments - current time with the default offset
* one argument
+ clock
+ zone id
+ another temporal entity
+ string representation
+ hour
* two arguments
+ formatter (format) and a string
+ local time and an offset
+ instant and an offset
+ hour and minutes
* three arguments - hours, minutes, seconds
* four arguments - hours, minutes, seconds, nanos
* five arguments - last is the offset
If zone offset is not specified, default will be used. You can check the
default offset by invoking `(zone-offset)`.", :tag java.time.OffsetTime} offset-time java-time.zone/offset-time)
(def ^{:arglists (quote ([] [y m d h] [y mo d h m] [y mo d h m s] [y mo d h m s n] [y mo d h m s n o] [arg0] [arg0 arg1] [arg0 arg1 arg2])), :doc "Creates a `ZonedDateTime`. The following arguments are supported:
* no arguments - current date-time in the default zone
* one argument
+ clock
+ zone id
+ another temporal entity
+ string representation
+ year
* two arguments
+ formatter and a string
+ local date-time and a zone id
+ year and month
* three arguments
+ local date, local time and a zone id
+ year, month and day
* four to seven arguments - date-time fields
* eight arguments - last is the zone id
If zone id is not specified, default zone id will be used. You can check the
default zone by invoking `(zone-id)`.", :tag java.time.ZonedDateTime} zoned-date-time java-time.zone/zoned-date-time)
(def ^{:arglists (quote ([] [k])), :doc "Creates a system clock. In the default time zone if called without arguments,
otherwise accepts a Zone Id.", :tag java.time.Clock} system-clock java-time.zone/system-clock)
(def ^{:arglists (quote ([] [i] [i z])), :doc "Creates a fixed clock either at the current instant or at the supplied
instant/instant + zone.", :tag java.time.Clock} fixed-clock java-time.zone/fixed-clock)
(def ^{:arglists (quote ([d] [^Clock c d])), :doc "Creates a clock offset from the current/provided clock by a given
`duration`.", :tag java.time.Clock} offset-clock java-time.zone/offset-clock)
(def ^{:arglists (quote ([d] [^Clock c d])), :doc "Creates a clock wrapping system/provided clock that only ticks as per
specified duration.", :tag java.time.Clock} tick-clock java-time.zone/tick-clock)
(def ^{:arglists (quote ([x])), :doc "Returns true if `x` is an instance of `java.time.Clock`."} clock? java-time.zone/clock?)
(def ^{:arglists (quote ([v])), :doc "Returns true if `v` is an instance of java.time.ZoneId, otherwise false."} zone-id? java-time.zone/zone-id?)
(def ^{:arglists (quote ([v])), :doc "Returns true if `v` is an instance of java.time.ZonedDateTime, otherwise false."} zoned-date-time? java-time.zone/zoned-date-time?)
(def ^{:arglists (quote ([v])), :doc "Returns true if `v` is an instance of java.time.OffsetDateTime, otherwise false."} offset-date-time? java-time.zone/offset-date-time?)
(def ^{:arglists (quote ([v])), :doc "Returns true if `v` is an instance of java.time.OffsetTime, otherwise false."} offset-time? java-time.zone/offset-time?)
(def ^{:arglists (quote ([^ZonedDateTime zdt z])), :doc "Sets the zone to the specified value ensuring that the result has the same instant, e.g.:
(zoned-date-time 2015)
=> #<java.time.ZonedDateTime 2015-01-01T00:00+00:00[Europe/London]>
(with-zone-same-instant *1 \"America/New_York\")
=> #<java.time.ZonedDateTime 2014-12-31T18:00-05:00[America/New_York]>"} with-zone-same-instant java-time.zone/with-zone-same-instant)
(defn ^{:doc "Sets the offset to the specified value ensuring that the local time stays
the same.
(offset-time 10 30 0 0 +2)
=> #<java.time.OffsetTime 10:30+02:00>
(with-offset *1 +3)
=> #<java.time.OffsetTime 10:30+03:00>"} with-offset ([o offset] (java-time.zone/with-offset o offset)))
(defn ^{:doc "Sets the offset to the specified value ensuring that the result has the same instant, e.g.:
(offset-time 10 30 0 0 +2)
=> #<java.time.OffsetTime 10:30+02:00>
(with-offset-same-instant *1 +3)
=> #<java.time.OffsetTime 11:30+03:00>"} with-offset-same-instant ([o offset] (java-time.zone/with-offset-same-instant o offset)))
(def ^{:arglists (quote ([] [instant] [instant zone])), :doc "Returns a mock implementation of the `java.time.Clock`. The mock supports
`advance-clock!` operation which allows to move the time in the clock, e.g.:
```
(let [clock (mock-clock 0 \"UTC\")]
(with-clock clock
(is (= (value clock) 0))
(is (= (instant) (instant 0)))
(advance-clock! clock (j/millis 1))
(is (= (value clock) 1))
(is (= (instant) (instant 1)))))
```
You can move the clock back via advancing by a negative temporal amount.
Creates a clock at epoch in the default time zone when called without arguments.", :tag java.time.Clock} mock-clock java-time.mock/mock-clock)
(def ^{:arglists (quote ([^IMockClock clock amount])), :doc "Advances the `clock` by the given time `amount`.
This mutates the mock clock."} advance-clock! java-time.mock/advance-clock!)
(def ^{:arglists (quote ([^Clock clock time])), :doc "Sets the `clock` to the given `time`.
This mutates the mock clock."} set-clock! java-time.mock/set-clock!)
(def ^{:arglists (quote ([e] [e value-fn])), :doc "Converts a time entity to a map of property key -> value as defined by the
passed in `value-fn`. By default the actual value of the unit/field is
produced.
```
(as-map (duration))
=> {:nanos 0, :seconds 0}
(as-map (local-date 2015 1 1))
=> {:year 2015, :month-of-year 1, :day-of-month 1, ...}
```"} as-map java-time.convert/as-map)
(def ^{:arglists (quote ([amount from-unit to-unit])), :doc "Converts an amount from one unit to another. Returns a map of:
* `:whole` - the whole part of the conversion in the `to` unit
* `:remainder` - the remainder in the `from` unit
Arguments may be keywords or instances of `TemporalUnit`.
Converts between precise units--nanos up to weeks---treating days as exact
multiples of 24 hours. Also converts between imprecise units---months up to
millennia. See `ChronoUnit` and `IsoFields` for all of the supported units.
Does not convert between precise and imprecise units.
Throws `ArithmeticException` if long overflow occurs during computation.
```
(convert-amount 10000 :seconds :hours)
=> {:remainder 2800 :whole 2}
```"} convert-amount java-time.convert/convert-amount)
(def ^{:arglists (quote ([o])), :deprecated true, :doc "Converts a date entity to a `java.util.Date`.
*Deprecated*:
This function only has a single arity and works for entities directly
convertible to `java.time.Instant`. Please consider using [[java-date]]
instead.", :tag java.util.Date} to-java-date java-time.convert/to-java-date)
(def ^{:arglists (quote ([o])), :deprecated true, :doc "Converts a local date entity to a `java.sql.Date`.
*Deprecated*:
This function only has a single arity and works for entities directly
convertible to `java.time.LocalDate`. Please consider using [[sql-date]]
instead.", :tag java.sql.Date} to-sql-date java-time.convert/to-sql-date)
(def ^{:arglists (quote ([o])), :deprecated true, :doc "Converts a date entity to a `java.sql.Timestamp`.
*Deprecated*:
This function only has a single arity and works for entities directly
convertible to `java.time.Instant`. Please consider using [[sql-timestamp]]
instead.", :tag java.sql.Timestamp} to-sql-timestamp java-time.convert/to-sql-timestamp)
(def ^{:arglists (quote ([o])), :doc "Converts a date entity to a `long` representing the number of milliseconds
from epoch."} to-millis-from-epoch java-time.convert/to-millis-from-epoch)
(def ^{:arglists (quote ([i])), :doc "Returns true if the given time entity with the
`day-of-week` property falls on a Monday, otherwise false."} monday? java-time.sugar/monday?)
(def ^{:arglists (quote ([i])), :doc "Returns true if the given time entity with the
`day-of-week` property falls on a Tuesday, otherwise false."} tuesday? java-time.sugar/tuesday?)
(def ^{:arglists (quote ([i])), :doc "Returns true if the given time entity with the
`day-of-week` property falls on a Wednesday, otherwise false."} wednesday? java-time.sugar/wednesday?)
(def ^{:arglists (quote ([i])), :doc "Returns true if the given time entity with the
`day-of-week` property falls on a Thursday, otherwise false."} thursday? java-time.sugar/thursday?)
(def ^{:arglists (quote ([i])), :doc "Returns true if the given time entity with the
`day-of-week` property falls on a Friday, otherwise false."} friday? java-time.sugar/friday?)
(def ^{:arglists (quote ([i])), :doc "Returns true if the given time entity with the
`day-of-week` property falls on a Saturday, otherwise false."} saturday? java-time.sugar/saturday?)
(def ^{:arglists (quote ([i])), :doc "Returns true if the given time entity with the
`day-of-week` property falls on a Sunday, otherwise false."} sunday? java-time.sugar/sunday?)
(def ^{:arglists (quote ([dt])), :doc "Returns true if argument is [[saturday?]] or [[sunday?]],
otherwise false."} weekend? java-time.sugar/weekend?)
(def ^{:arglists (quote ([dt])), :doc "Complement of [[weekend?]]."} weekday? java-time.sugar/weekday?)
(def ^{:arglists (quote ([f initial v & vs])), :doc "Returns a lazy sequence of `initial` , `(apply f initial v vs)`, etc.
Useful when you want to produce a sequence of temporal entities, for
example:
```
(iterate plus (days 0) 1)
=> (#<Period P0D> #<Period P1D> #<Period P2D> ...)
(iterate plus (local-date 2010 1 1) (years 1))
=> (#<LocalDate 2010-01-01> #<LocalDate 2011-01-01> ...)
(iterate adjust (local-date 2010 1 1) :next-working-day)
=> (#<LocalDate 2010-01-01> #<LocalDate 2010-01-04> ...)
```"} iterate java-time.seqs/iterate)
(def ^{:arglists (quote ([entity adjuster & args])), :doc "Adjusts the temporal `entity` using the provided `adjuster` with optional `args`.
The adjuster should either be a keyword which resolves to one of the
predefined adjusters (see [[java-time.repl/show-adjusters]]) an instance of
`TemporalAdjuster` or a function which returns another temporal entity when
applied to the given one:
```
(adjust (local-date 2015 1 1) :next-working-day)
=> #<LocalDate 2015-1-2>
(adjust (local-date 2015 1 1) :first-in-month :monday)
=> #<LocalDate 2015-1-5>
(adjust (local-date 2015 1 1) plus (days 1))
=> #<LocalDate 2015-1-2>
```"} adjust java-time.adjuster/adjust)
(def ^{:arglists (quote ([o] [fmt o])), :doc "Formats the given time entity as a string.
Accepts something that can be converted to a `DateTimeFormatter` or a
formatter key, e.g. `:iso-offset-time`, as a first argument. Given one
argument uses the default format.
```
(format (zoned-date-time))
=> \"2015-03-21T09:22:46.677800+01:00[Europe/London]\"
(format :iso-date (zoned-date-time))
\"2015-03-21+01:00\"
```"} format java-time.format/format)
(def ^{:arglists (quote ([fmt] [fmt arg1])), :doc "Constructs a DateTimeFormatter out of a
* format string - \"yyyy/MM/dd\", \"HH:mm\", etc.
* formatter name - :iso-date, :iso-time, etc.
Accepts a map of options as an optional second argument:
* `resolver-style` - either `:strict`, `:smart` or `:lenient`
* `case` - either `:insensitive` or `:sensitive` (defaults to :sensitive)", :tag java.time.format.DateTimeFormatter} formatter java-time.format/formatter)
(def ^{:arglists (quote ([] [a] [a b])), :doc "Creates a `java.util.Date` out of any combination of arguments valid for
[[instant]] or the Instant itself.
A `java.util.Date` represents an instant in time. It's a direct analog of the
`java.time.Instant` type introduced in the JSR-310. Please consider using the
`java.time.Instant` (through [[instant]]) directly.", :tag java.util.Date} java-date java-time.pre-java8/java-date)
(def ^{:arglists (quote ([] [arg0] [arg0 arg1] [arg0 arg1 arg2])), :doc "Creates a `java.sql.Date` out of any combination of arguments valid for
[[local-date]] or the `LocalDate` itself.
Please consider using the JSR-310 Java Time types instead of `java.sql.Date`
if your drivers support them.
Even though `java.sql.Date` extends a `java.util.Date`, it's supposed to be
used as a local date (no time component or time zone) for the purposes of
conversion from/to native JDBC driver DATE types.", :tag java.sql.Date} sql-date java-time.pre-java8/sql-date)
(def ^{:arglists (quote ([] [arg0] [arg0 arg1] [arg0 arg1 arg2] [arg0 arg1 arg2 arg3] [arg0 arg1 arg2 arg3 arg4] [arg0 arg1 arg2 arg3 arg4 arg5] [arg0 arg1 arg2 arg3 arg4 arg5 arg6])), :doc "Creates a `java.sql.Timestamp` in the local time zone out of any combination
of arguments valid for [[local-date-time]] or the `LocalDateTime`
itself.
Does not support `Timestamp` construction from an `Instant` or a long millis value---please use
[[instant->sql-timestamp]] for this purpose.
Please consider using the JSR-310 Java Time types instead of
`java.sql.Timestamp` if your drivers support them.
`java.sql.Timestamp` is a version of a `java.util.Date` supposed to be used
as a local date-time (no time zone) for the purposes of conversion from/to native
JDBC driver TIMESTAMP types.", :tag java.sql.Timestamp} sql-timestamp java-time.pre-java8/sql-timestamp)
(def ^{:arglists (quote ([instant-or-millis])), :doc "Creates a `java.sql.Timestamp` from the provided `instant-or-millis` - a
millisecond numeric time value or something convertible to an `Instant`.
Please consider using the JSR-310 Java Time types instead of
`java.sql.Timestamp` if your drivers support them.
`java.sql.Timestamp` is a version of a `java.util.Date` supposed to be used
as a local date-time (no time zone) for the purposes of conversion from/to native
JDBC driver TIMESTAMP types."} instant->sql-timestamp java-time.pre-java8/instant->sql-timestamp)
(java-time.util/when-class "java.sql.Time" (def ^{:arglists (quote ([] [arg0] [arg0 arg1] [arg0 arg1 arg2])), :doc "Creates a `java.sql.Time` out of any combination of arguments valid for
[[local-time]] (except the nanos constructor) or the `LocalTime`
itself.
Please consider using the JSR-310 Java Time types instead of `java.sql.Time`
if your drivers support them.
Even though `java.sql.Time` extends a `java.util.Date`, it's supposed to be
used as a local time (no date component or time zone) for the purposes of
conversion from/to native JDBC driver TIME types.", :tag java.sql.Time} sql-time java-time.pre-java8/sql-time))
(defn ^{:doc "Moves the start instant of the interval to the given instant (or something
convertible to an instant):
```
(move-start-to (interval 0 10000) (instant 5000))
=> #<Interval ...:05Z/...:10Z>
```
Fails if the new start instant falls after the end instant:
```
(move-start-to (interval 0 10000) (millis 15000))
=> DateTimeException...
```"} move-start-to ([i new-start] (java-time.interval/move-start-to i new-start)))
(defn ^{:doc "Moves the end of the interval to the given instant (or something
convertible to an instant):
```
(move-end-to (interval 0 10000) (instant 15000))
=> #<Interval ...:00Z/...:15Z>
```
Fails if the new end instant falls before the start instant:
```
(move-end-to (interval 0 10000) (millis -1))
=> DateTimeException...
```"} move-end-to ([i new-end] (java-time.interval/move-end-to i new-end)))
(def ^{:arglists (quote ([i & os])), :doc "Moves the start instant of the interval by the sum of given
periods/durations/numbers of milliseconds:
```
(move-start-by (interval 0 10000) (millis 1000) (seconds 1))
=> #<Interval ...:02Z/...:10Z>
```
Fails if the new start instant falls after the end instant.
```
(move-start-by (interval 0 10000) (millis 11000))
;=> DateTimeException...
```"} move-start-by java-time.interval/move-start-by)
(def ^{:arglists (quote ([i & os])), :doc "Moves the end instant of the interval by the sum of given
periods/durations/numbers of milliseconds.
```
(move-start-by (interval 0 10000) (millis 1000) (seconds 1))
=> #<Interval ...:00Z/...:12Z>
```
Fails if the new end instant falls before the start instant.
```
(move-end-by (interval 0 10000) (millis -11000))
=> DateTimeException...
```"} move-end-by java-time.interval/move-end-by)
(defn ^{:doc "Gets the start instant of the interval"} start ([i] (java-time.interval/start i)))
(defn ^{:doc "Gets the end instant of the interval"} end ([i] (java-time.interval/end i)))
(defn ^{:doc "True if the interval contains the given instant or interval"} contains? ([i o] (java-time.interval/contains? i o)))
(defn ^{:doc "True if this interval overlaps the other one"} overlaps? ([i oi] (java-time.interval/overlaps? i oi)))
(defn ^{:doc "True if this interval abut with the other one"} abuts? ([i oi] (java-time.interval/abuts? i oi)))
(defn ^{:doc "Gets the overlap between this interval and the other one or `nil`"} overlap ([i oi] (java-time.interval/overlap i oi)))
(defn ^{:doc "Gets the gap between this interval and the other one or `nil`"} gap ([i oi] (java-time.interval/gap i oi)))
(java-time.util/when-class "org.threeten.extra.Temporals" (def ^{:arglists (quote ([^String o] [a b])), :doc "Constructs an interval out of a string, start and end instants or a start
+ duration:
```
(j/interval \"2010-01-01T00:00:00Z/2013-01-01T00:00:00Z\")
=> #<Interval 2010-01-01T00:00:00Z/2013-01-01T00:00:00Z>
(j/interval (j/instant 100000) (j/instant 1000000))
=> #<Interval 1970-01-01T00:01:40Z/1970-01-01T00:16:40Z>
(j/interval (j/instant 100000) (j/duration 15 :minutes))
=> #<Interval 1970-01-01T00:01:40Z/1970-01-01T00:16:40Z>
```
Requires the optional `threeten-extra` dependency.", :tag org.threeten.extra.Interval} interval java-time.interval/interval) (def ^{:arglists (quote ([o])), :doc "True if `Interval`"} interval? java-time.interval/interval?) (def ^{:arglists (quote ([] [v] [fmt arg])), :doc "Returns the `AmPm` for the given keyword name (`:am` or `:pm`),
ordinal or entity. Current AM/PM if no arguments given.", :tag org.threeten.extra.AmPm} am-pm java-time.single-field/am-pm) (def ^{:arglists (quote ([o])), :doc "True if `org.threeten.extra.AmPm`."} am-pm? java-time.single-field/am-pm?) (def ^{:arglists (quote ([] [v] [fmt arg])), :doc "Returns the `Quarter` for the given quarter keyword name (e.g. `:q1`),
ordinal or entity. Current quarter if no arguments given.", :tag org.threeten.extra.Quarter} quarter java-time.single-field/quarter) (def ^{:arglists (quote ([o])), :doc "True if `org.threeten.extra.Quarter`."} quarter? java-time.single-field/quarter?) (def ^{:arglists (quote ([] [arg] [fmt arg])), :doc "Returns the `DayOfMonth` for the given entity, clock, zone or day of month.
Current day of month if no arguments given.", :tag org.threeten.extra.DayOfMonth} day-of-month java-time.single-field/day-of-month) (def ^{:arglists (quote ([o])), :doc "Returns true if `o` is `org.threeten.extra.DayOfMonth`, otherwise false."} day-of-month? java-time.single-field/day-of-month?) (def ^{:arglists (quote ([] [arg] [fmt arg])), :doc "Returns the `DayOfYear` for the given entity, clock, zone or day of year.
Current day of year if no arguments given.", :tag org.threeten.extra.DayOfYear} day-of-year java-time.single-field/day-of-year) (def ^{:arglists (quote ([o])), :doc "Returns true if `o` is `org.threeten.extra.DayOfYear`, otherwise false."} day-of-year? java-time.single-field/day-of-year?) (def ^{:arglists (quote ([] [arg] [a b])), :doc "Returns the `YearQuarter` for the given entity, clock, zone or year with quarter.
Current year quarter if no arguments given.", :tag org.threeten.extra.YearQuarter} year-quarter java-time.single-field/year-quarter) (def ^{:arglists (quote ([o])), :doc "Returns true if `o` is `org.threeten.extra.YearQuarter`, otherwise false."} year-quarter? java-time.single-field/year-quarter?))