You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
There are four DateTime returning methods: dateTime, dateTimeAD, dateTimeBetween, and dateTimeInterval, Two of them set the time zone (dateTimeBetween and dateTimeInterval) on the returned object, while the other two do not. This leads to user land code having to juggle time zones when comparing dates returned from the different generators.
The generators should all return times in the same zone, unless the user specifically says to return times in different time zones. PR #675 adds this support:
$faker->dateTime; // time zone is UTC
$faker->dateTime('now', 'America/New_York'); // custom time zone
// likewise for dateTimeAD, dateTimeBetween, and dateTimeInterval
The text was updated successfully, but these errors were encountered:
Question follows: should dateTimeBetween return such a time stamp as well? My opinion is that it actually should.
Method dateTimeInterval gets a DateTime object based on a random date between two given dates, dateTimeInterval gets a DateTime object based on a random date between one given date and an interval.
It might be a bit tricky to implement but I need to see how that interval thing actually works. If someone has some sample data, please feel free to post it to this thread.
The now closed PR #675 standardized this behavior: all these methods now return a \DateTime with the timezone set to the system default, with the possibility to set the timezone in the generator.
There are four DateTime returning methods:
dateTime
,dateTimeAD
,dateTimeBetween
, anddateTimeInterval
, Two of them set the time zone (dateTimeBetween
anddateTimeInterval
) on the returned object, while the other two do not. This leads to user land code having to juggle time zones when comparing dates returned from the different generators.The generators should all return times in the same zone, unless the user specifically says to return times in different time zones. PR #675 adds this support:
The text was updated successfully, but these errors were encountered: