uutils / parse_datetime

Parses a relative time string and returns a `Duration`
MIT License
16 stars 19 forks source link

use local instead of utc in parse_relative_time #80

Open drmorr0 opened 3 months ago

drmorr0 commented 3 months ago

The parse_relative_time function is using Utc::now().date_naive() to get today's date, but parse_relative_time_at_date uses Local::now().date_naive(); these two values are subtracted, which gives incorrect results when Utc and Local time span midnight.

I think this fixes #36, at least in the short term

drmorr0 commented 2 weeks ago

@tertsdiepraam hi, just wondering if there's any progress towards merging this? Happy to make any changes as needed.

cakebaker commented 2 weeks ago

I think this has been fixed in https://github.com/uutils/parse_datetime/pull/85?