mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-22 00:09:59 +01:00
Merge pull request #52 from blaugueux/master
Added timezone generator to DateTime provider
This commit is contained in:
commit
e288d3ca6c
@ -142,6 +142,7 @@ Each of the generator properties (like `name`, `address`, and `lorem`) are calle
|
||||
monthName // 'January'
|
||||
year // '1993'
|
||||
century // 'VI'
|
||||
timezone // 'Europe/Paris'
|
||||
|
||||
### `Faker\Provider\Miscellaneous`
|
||||
|
||||
|
@ -178,4 +178,11 @@ class DateTime extends \Faker\Provider\Base
|
||||
return static::randomElement(static::$century);
|
||||
}
|
||||
|
||||
/**
|
||||
* @example 'Europe/Paris'
|
||||
*/
|
||||
public static function timezone()
|
||||
{
|
||||
return static::randomElement(\DateTimeZone::listIdentifiers());
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user