Skip to content

Commit f2ece57

Browse files
authored
Update docs for date faking (#1534)
1 parent 49f706a commit f2ece57

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

docs/documentation/date-format.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@ Since 1.2.0 Datafaker supports specifying of date formats for dates and timestam
77

88
``` java
99
Faker faker = new Faker();
10-
System.out.println(faker.date().future(1, TimeUnit.HOURS, "YYYY MM.dd mm:hh:ss");
11-
System.out.println(faker.date().past(1, TimeUnit.HOURS, "YYYY-MM-dd mm:hh:ss");
12-
System.out.println(faker.date().birthday(1, 99, "YYYY/MM/dd");
13-
10+
System.out.println(faker.timeAndDate().future(1, TimeUnit.HOURS, "YYYY MM.dd mm:hh:ss"));
11+
System.out.println(faker.timeAndDate().past(1, TimeUnit.HOURS, "YYYY-MM-dd mm:hh:ss"));
12+
System.out.println(faker.timeAndDate().birthday(1, 99, "YYYY/MM/dd"));
1413
```
1514

1615
And also this feature could be used in expressions like
1716

1817
=== "Java"
1918

2019
``` java
21-
faker.expression("#{date.past '15','SECONDS','dd/MM/yyyy hh:mm:ss'}")
20+
faker.expression("#{date.past '15','SECONDS','dd/MM/yyyy hh:mm:ss'}");
2221
```
2322

2423
List of available time units:

src/main/java/net/datafaker/providers/base/DateAndTime.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*
1919
* @author pmiklos
2020
* @since 0.8.0
21+
* @deprecated Use {@link TimeAndDate} instead.
2122
*/
2223
@Deprecated(since = "2.3.0", forRemoval = true)
2324
public class DateAndTime extends AbstractProvider<BaseProviders> {

0 commit comments

Comments
 (0)