1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-19 06:49:50 +01:00

add doc about seeding with maximum timestamp using dateTime formatters

This commit is contained in:
Francois Zaninotto 2014-03-21 18:22:03 +01:00
parent 4ca3829d9d
commit 98f400afc8

View File

@ -370,6 +370,13 @@ $faker->seed(1234);
echo $faker->name; // 'Jess Mraz I';
```
> **Tip**: DateTime formatters won't reproduce the same fake data if you don't fix the `$max` value:
>
> // even when seeded, this line will return different results because $max varies
> $faker->dateTime(); // equivalent to $faker->dateTime($max = 'now')
> // make sure you fix the $max parameter
> $faker->dateTime('2014-02-25 08:37:17'); // will return always the same date when seeded
## Faker Internals: Understanding Providers
A `Faker\Generator` alone can't do much generation. It needs `Faker\Provider` objects to delegate the data generation to them. `Faker\Factory::create()` actually creates a `Faker\Generator` bundled with the default providers. Here is what happens under the hood: