Generators
instant
Dates and times as Timestamp, with no Foundation dependency.
var faker = Faker(seed: 1337, locale: DecoyLocaleEN.locale)faker.instant.past()| Method | Example output |
|---|---|
past(years: Double = 1) |
2025-11-30T15:31:55Z2025-01-14T06:45:06Z2025-01-16T03:40:22Z |
future(years: Double = 1) |
2026-04-08T02:42:44Z2026-03-02T12:12:22Z2026-01-22T10:20:59Z |
recent(days: Int = 1) |
2025-12-31T14:56:35Z2025-12-31T10:00:11Z2025-12-31T20:57:22Z |
soon(days: Int = 1) |
2026-01-01T02:07:23Z2026-01-01T13:58:08Z2026-01-01T01:38:33Z |
between(_ start: Timestamp, _ end: Timestamp) |
needs arguments |
birthdate(minAge: Int = 18, maxAge: Int = 80) |
1955-05-05T09:47:22Z1952-03-28T04:16:40Z1972-02-10T02:41:09Z |
monthName(abbreviated: Bool = false) |
MarchSeptemberFebruary |
weekdayName(abbreviated: Bool = false) |
TuesdayThursdayMonday |
timeZone() |
Asia/AnadyrAmerica/SantaremAmerica/Chicago |
year(in range: ClosedRange<Int>? = nil) |
193119301929 |
month() |
396 |
dayOfMonth() |
201315 |
dayOfWeek() |
561 |
hour() |
1978 |
minute() |
92852 |
amPm() |
PMAM |
unix(years: Double = 30) |
182717010220432514141209413941 |
century() |
IVVIIII |
Examples are real output from three different seeds, captured when this page was built, using each method’s default arguments. Where a signature shows parameters, pass your own to change the size, gender, length or format.