-
-
Notifications
You must be signed in to change notification settings - Fork 949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faker dates are not reproducible with fixed seed. #1870
Comments
Also why does the |
Thnxs @Shinigami92. The refDate works great! I was using the non-refDate api before and ran into this problem before learning about the refDate parameter. Thank you again. |
i think this could be added as a note to the refDate parameter in the documentation? Something like "If a refDate is provided, dates generated with a fixed |
I would phrase it independently from seed something like this: Required (here or via faker.refDateSource), if reproducible results are needed. If defined, the returned value will be relative to the given date. If absent, the returned value will be relative to now. |
Is refDateSource documented anywhere? |
The methods on the faker instance itself, dont have a documentation yet. My idea was mostly to give our users the hint that such a property exists. |
I think it could be useful to add a section to the Usage Guide about this. I made PR #1892 for that. Then maybe the 4 faker.date.* methods that have refDate could link to this section for more details. |
Hi. Two questions:
|
|
Pre-Checks
Describe the bug
Faker-generated dates using past and recent functions are not reproducible given a fixed seed. Seems like there is a slight drift in the regeneration....
Is there a way to fix the generated dates with a given seed?
Minimal reproduction code
Additional Context
No response
Environment Info
Which module system do you use?
Used Package Manager
pnpm
The text was updated successfully, but these errors were encountered: