|
94 | 94 | (def ^{:arglists (quote ([^ZonedDateTime zdt z])), :doc "Sets the zone to the specified value ensuring that the result has the same instant, e.g.:\n\n (zoned-date-time 2015)\n => #<java.time.ZonedDateTime 2015-01-01T00:00+00:00[Europe/London]>\n (with-zone-same-instant *1 \"America/New_York\")\n => #<java.time.ZonedDateTime 2014-12-31T18:00-05:00[America/New_York]>"} with-zone-same-instant java-time.zone/with-zone-same-instant) |
95 | 95 | (def ^{:arglists (quote ([o offset])), :doc "Sets the offset to the specified value ensuring that the local time stays\n the same.\n\n (offset-time 10 30 0 0 +2)\n => #<java.time.OffsetTime 10:30+02:00>\n (with-offset *1 +3)\n => #<java.time.OffsetTime 10:30+03:00>"} with-offset java-time.zone/with-offset) |
96 | 96 | (def ^{:arglists (quote ([o offset])), :doc "Sets the offset to the specified value ensuring that the result has the same instant, e.g.:\n\n (offset-time 10 30 0 0 +2)\n => #<java.time.OffsetTime 10:30+02:00>\n (with-offset-same-instant *1 +3)\n => #<java.time.OffsetTime 11:30+03:00>"} with-offset-same-instant java-time.zone/with-offset-same-instant) |
97 | | -#?(:bb nil :default (def ^{:arglists ([] [instant] [instant zone]), :doc "Returns a mock implementation of the `java.time.Clock`. The mock supports\n `advance-clock!` operation which allows to move the time in the clock, e.g.:\n\n ```\n (let [clock (mock-clock 0 \"UTC\")]\n (with-clock clock\n (is (= (value clock) 0))\n (is (= (instant) (instant 0)))\n (advance-clock! clock (j/millis 1))\n (is (= (value clock) 1))\n (is (= (instant) (instant 1)))))\n ```\n\n You can move the clock back via advancing by a negative temporal amount.\n\n Creates a clock at epoch in the default time zone when called without arguments.\n \n Not available in babashka.", :tag java.time.Clock} mock-clock ^{:java-time.dev.gen/no-babashka true} java-time.mock/mock-clock)) |
98 | | -#?(:bb nil :default (def ^{:arglists ([^IMockClock clock amount]), :doc "Advances the `clock` by the given time `amount`.\n\n This mutates the mock clock.\n \n Not available in babashka."} advance-clock! ^{:java-time.dev.gen/no-babashka true} java-time.mock/advance-clock!)) |
99 | | -#?(:bb nil :default (def ^{:arglists ([^Clock clock time]), :doc "Sets the `clock` to the given `time`.\n\n This mutates the mock clock.\n\n Not available in babashka."} set-clock! ^{:java-time.dev.gen/no-babashka true} java-time.mock/set-clock!)) |
| 97 | +#?(:bb nil :default (def ^{:arglists (quote ([] [instant] [instant zone])), :doc "Returns a mock implementation of the `java.time.Clock`. The mock supports\n `advance-clock!` operation which allows to move the time in the clock, e.g.:\n\n ```\n (let [clock (mock-clock 0 \"UTC\")]\n (with-clock clock\n (is (= (value clock) 0))\n (is (= (instant) (instant 0)))\n (advance-clock! clock (j/millis 1))\n (is (= (value clock) 1))\n (is (= (instant) (instant 1)))))\n ```\n\n You can move the clock back via advancing by a negative temporal amount.\n\n Creates a clock at epoch in the default time zone when called without arguments.\n \n Not available in babashka.", :tag java.time.Clock} mock-clock java-time.mock/mock-clock)) |
| 98 | +#?(:bb nil :default (def ^{:arglists (quote ([^IMockClock clock amount])), :doc "Advances the `clock` by the given time `amount`.\n\n This mutates the mock clock.\n \n Not available in babashka."} advance-clock! java-time.mock/advance-clock!)) |
| 99 | +#?(:bb nil :default (def ^{:arglists (quote ([^Clock clock time])), :doc "Sets the `clock` to the given `time`.\n\n This mutates the mock clock.\n\n Not available in babashka."} set-clock! java-time.mock/set-clock!)) |
100 | 100 | (def ^{:arglists (quote ([e] [e value-fn])), :doc "Converts a time entity to a map of property key -> value as defined by the\n passed in `value-fn`. By default the actual value of the unit/field is\n produced.\n\n ```\n (as-map (duration))\n => {:nanos 0, :seconds 0}\n\n (as-map (local-date 2015 1 1))\n => {:year 2015, :month-of-year 1, :day-of-month 1, ...}\n ```"} as-map java-time.convert/as-map) |
101 | 101 | (def ^{:arglists (quote ([amount from-unit to-unit])), :doc "Converts an amount from one unit to another. Returns a map of:\n\n * `:whole` - the whole part of the conversion in the `to` unit\n * `:remainder` - the remainder in the `from` unit\n\n Arguments may be keywords or instances of `TemporalUnit`.\n\n Converts between precise units--nanos up to weeks---treating days as exact\n multiples of 24 hours. Also converts between imprecise units---months up to\n millennia. See `ChronoUnit` and `IsoFields` for all of the supported units.\n Does not convert between precise and imprecise units.\n\n Throws `ArithmeticException` if long overflow occurs during computation.\n\n ```\n (convert-amount 10000 :seconds :hours)\n => {:remainder 2800 :whole 2}\n ```"} convert-amount java-time.convert/convert-amount) |
102 | 102 | (def ^{:arglists (quote ([o])), :deprecated true, :doc "Converts a date entity to a `java.util.Date`.\n\n *Deprecated*:\n This function only has a single arity and works for entities directly\n convertible to `java.time.Instant`. Please consider using [[java-date]]\n instead.", :tag java.util.Date} to-java-date java-time.convert/to-java-date) |
|
0 commit comments