Skip to content

timezone() does not respect country code #606

@jefhar

Description

@jefhar

Summary

Faker\Provider\DateTime::timezone() is missing the optional $countryCode that is found in Faker\Core\DateTime::timezone().

This has the effect (in Laravel anyway) that fake()->timezone('US') provides a random timezone instead of returning a timezone in the designated country code.

Versions

Version
PHP 8.2
fakerphp/faker 1.21.0

Self-enclosed code snippet for reproduction

fake()->timezone('US');

Expected output

"America/Indiana/Knox"

Actual output

Africa/Algiers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions