kennethreitz / kennethreitz/maya

day_first parse when year_first format does nothing?

Open
#201 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.4k
Forks
197
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Can't get it to parse as american time when the year is written first

**Environment and Version**
* OS (incl. terminal and shell used): Win 10
* Python Version: 3.10.1
* maya Version: 0.6.1
* Your timezone: GMT+3

**To Reproduce**
```
>>> maya.parse("2024-01-12 17:13:51", "UTC", True).datetime()
datetime.datetime(2024, 1, 12, 17, 13, 51, tzinfo=)
>>> maya.parse("2024-01-12 17:13:51", "UTC", False).datetime()
datetime.datetime(2024, 1, 12, 17, 13, 51, tzinfo=)
```

**Expected behavior**
A way to make it parse `2024-01-12 ` as 1st of December, not 12th of January

Contributor guide

Open the contributing guide

Research direction

Start at the maya.parse entry point and reproduce both calls from the issue with Python 3.10.1 and maya 0.6.1. Determine how the day_first and year_first settings are interpreted for the year-first input, then verify that the selected setting produces the expected January or December date.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.