= JavaTimeDateTimes
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Returns a random _OffsetDateTime_ , optionally based on the current time but constrained by a _Period_ .

The current time ('now') is obtained from the _org.apache.causeway.applib.services.clock.ClockService_ .

== API

[source,java]
.JavaTimeDateTimes.java
----
class JavaTimeDateTimes {
  JavaTimeDateTimes(FakeDataService fakeDataService)
  OffsetDateTime around(Period period)     // <.>
  OffsetDateTime before(Period period)     // <.>
  OffsetDateTime after(Period period)     // <.>
  OffsetDateTime any()     // <.>
}
----

<.> xref:#around_Period[around(Period)]
+
--
Returns a random date either before or after 'now', within the specified _Period_ .
--
<.> xref:#before_Period[before(Period)]
+
--
Returns a random date some time before 'now', within the specified _Period_ .
--
<.> xref:#after_Period[after(Period)]
+
--
Returns a random date/time some time after 'now', within the specified _Period_ .
--
<.> xref:#any_[any()]
+
--
Returns a random date/time 5 years around 'now'.
--

== Members

[#around_Period]
=== around(Period)

Returns a random date either before or after 'now', within the specified _Period_ .

[#before_Period]
=== before(Period)

Returns a random date some time before 'now', within the specified _Period_ .

[#after_Period]
=== after(Period)

Returns a random date/time some time after 'now', within the specified _Period_ .

[#any_]
=== any()

Returns a random date/time 5 years around 'now'.
