codecov[bot]: # [Codecov](https://codecov.io/gh/destag/at-date/pull/17?src=pr&el=h1) Report
> Merging [#17](https://codecov.io/gh/destag/at-date/pull/17?src=pr&el=desc) into [master](https://codecov.io/gh/destag/at-date/commit/3957d0b750ef1205adb0ba2fc3dccf34c3f0ce62?src=pr&el=desc) will **increase** coverage by `0.03%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/destag/at-date/pull/17/graphs/tree.svg?width=650&token=zT5lrR9jF6&height=150&src=pr)](https://codecov.io/gh/destag/at-date/pull/17?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
+ Coverage   99.21%   99.25%   +0.03%     
==========================================
  Files           3        3              
  Lines         128      134       +6     
==========================================
+ Hits          127      133       +6     
  Misses          1        1
```


| [Impacted Files](https://codecov.io/gh/destag/at-date/pull/17?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [atdate/atdate\_format.py](https://codecov.io/gh/destag/at-date/pull/17/diff?src=pr&el=tree#diff-YXRkYXRlL2F0ZGF0ZV9mb3JtYXQucHk=) | `100% <ø> (ø)` | :arrow_up: |
| [atdate/api.py](https://codecov.io/gh/destag/at-date/pull/17/diff?src=pr&el=tree#diff-YXRkYXRlL2FwaS5weQ==) | `99.21% <100%> (+0.03%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/destag/at-date/pull/17?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/destag/at-date/pull/17?src=pr&el=footer). Last update [3957d0b...4c68f85](https://codecov.io/gh/destag/at-date/pull/17?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

andrzej3393: I fixed it :slightly_smiling_face: Also, added some docs, but I'm not sure if they're enough.
diff --git a/atdate/api.py b/atdate/api.py
index b42b2ac..7f1af8e 100644
--- a/atdate/api.py
+++ b/atdate/api.py
@@ -15,7 +15,9 @@ class AtDateParser:
         tree = self.parser.parse(string_to_parse.lower())
         new_tree = transformer.transform(tree)
 
-        next_time_run = new_tree if isinstance(new_tree, datetime) else new_tree.children[-1]
+        next_time_run = new_tree
+        while not isinstance(next_time_run, datetime):
+            next_time_run = next_time_run.children[-1]
 
         if next_time_run < transformer.now:
             raise ValueError
@@ -65,7 +67,7 @@ class AtDateTransformer(Transformer):
         self.datetime_params['second'] = 0
         return datetime(**self.datetime_params)
 
-    def _hr24clock_hour_minute(self, matches):
+    def _iso_time(self, matches):
         hour = int(matches[0])
         minute = int(matches[1])
         next_day = self._check_if_next_day(hour, minute)
@@ -152,6 +154,13 @@ class AtDateTransformer(Transformer):
         self.datetime_params['year'] = year
         return datetime(**self.datetime_params)
 
+    def _iso_date(self, matches):
+        year, month, day = map(int, matches)
+        self.datetime_params['day'] = day
+        self.datetime_params['month'] = month
+        self.datetime_params['year'] = year
+        return datetime(**self.datetime_params)
+
     def _next(self, matches):
         inc_period = matches[0] if matches[0].endswith('s') else matches[0] + 's'
         dt = datetime(**self.datetime_params)
diff --git a/atdate/atdate_format.py b/atdate/atdate_format.py
index 42e910b..f163137 100644
--- a/atdate/atdate_format.py
+++ b/atdate/atdate_format.py
@@ -3,25 +3,30 @@ format_string = r'''
          | time date
          | time increment
          | time date increment
+         | date time
+         | isodate "t" isotime
          | date
          | date increment
          | nowspec
          | nowspec increment
          | increment
-time: HR24CLOCK_HR_MIN                            -> _hr24clock_hr_min
-    | HR24CLOCK_HOUR ":" MINUTE                   -> _hr24clock_hour_minute
-    | WALLCLOCK_HR_MIN AM_PM                      -> _wallclock_hr_min_am_pm
-    | WALLCLOCK_HOUR ":" MINUTE AM_PM             -> _wallclock_hour_minute_am_pm
-    | "noon"                                      -> _noon
-    | "midnight"                                  -> _midnight
-date: MONTH_NAME DAY_NUMBER                       -> _month_name_day_number
-    | MONTH_NUMBER "/" DAY_NUMBER                 -> _month_number_day_number
-    | MONTH_NUMBER "/" DAY_NUMBER "/" YEAR_NUMBER -> _month_number_day_number_year_number
-    | DAY_NUMBER "." MONTH_NUMBER                 -> _day_number_month_number
-    | DAY_NUMBER "." MONTH_NUMBER "." YEAR_NUMBER -> _day_number_month_number_year_number
-increment: "next" INC_PERIOD                      -> _next
-         | "+" INT INC_PERIOD                     -> _inc_number
-nowspec: "now"                                    -> _now
+time: HR24CLOCK_HR_MIN                               -> _hr24clock_hr_min
+    | WALLCLOCK_HR_MIN AM_PM                         -> _wallclock_hr_min_am_pm
+    | WALLCLOCK_HOUR ":" MINUTE AM_PM                -> _wallclock_hour_minute_am_pm
+    | "noon"                                         -> _noon
+    | "midnight"                                     -> _midnight
+    | isotime
+date: MONTH_NAME DAY_NUMBER                          -> _month_name_day_number
+    | MONTH_NUMBER "/" DAY_NUMBER                    -> _month_number_day_number
+    | MONTH_NUMBER "/" DAY_NUMBER "/" YEAR_NUMBER    -> _month_number_day_number_year_number
+    | DAY_NUMBER "." MONTH_NUMBER                    -> _day_number_month_number
+    | DAY_NUMBER "." MONTH_NUMBER "." YEAR_NUMBER    -> _day_number_month_number_year_number
+    | isodate
+isodate: YEAR_NUMBER "-" MONTH_NUMBER "-" DAY_NUMBER -> _iso_date
+isotime: HR24CLOCK_HOUR ":" MINUTE                   -> _iso_time
+increment: "next" INC_PERIOD                         -> _next
+         | "+" INT INC_PERIOD                        -> _inc_number
+nowspec: "now"                                       -> _now
 INC_PERIOD: "minutes" | "minute"
           | "hours" | "hour"
           | "days" | "day"
diff --git a/docs/README.md b/docs/README.md
index b33fdbd..ab82ea5 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -98,15 +98,18 @@ tokens|example
 [time] [increment]|17:32 next day
 [time] [date] [increment]|17:32 11/22/2033 next day
 [date]|11/22/2033
+[date] [time]|11/22/2033 17:32
 [date] [increment]|11/22/2033 next month
 [now]|now
 [now] [increment]|now next day
 [increment]|next month
+[isodatetime]|2033-11-22T17:32
 
 [time]: #time
 [date]: #date
 [increment]: #increment
 [now]: #now
+[isodatetime]: #isodatetime
 
 ### At date tokens
 
@@ -135,6 +138,7 @@ format|example
 \[1-12\] / \[1-31\] / \[0-9999\]|10/27/2006
 \[1-12\] . \[1-31\]|10.27
 \[1-12\] . \[1-31\] . \[0-9999\]|10.27.2006
+\[0-9999\] - \[1-12\] - \[1-31\]|2006-10-27
 
 #### increment
 
@@ -145,6 +149,14 @@ format|example
 next \[[period](#period)\]|next month
 \+ \[0-9999\] \[[period](#period)\]|\+ 12 minutes
 
+#### isodatetime
+
+Format for ISO 8601 date time.
+
+format|example
+---|---
+\[0-9999\] - \[1-12\] - \[1-31\] T \[0-23\] : \[0-59\]|2033-11-22T17:32
+
 #### now
 
 Format for this token is literally `now`.

ISO 8601 compatibility 
I think that it would be nice to support dates and times in ISO 8601 format. 
diff --git a/test/test_atdate.py b/test/test_atdate.py
index fdbf0ce..8c23f7c 100644
--- a/test/test_atdate.py
+++ b/test/test_atdate.py
@@ -220,3 +220,31 @@ def test_plus_one_day_without_now():
     test_string = '+1days'
     result = atdate.parse(test_string)
     assert result == datetime(2000, 7, 3, 3, 4, 5, 0)
+
+
+@freeze_time('2000-07-02 03:04:05')
+def test_isodate():
+    test_string = '2011-09-22'
+    result = atdate.parse(test_string)
+    assert result == datetime(2011, 9, 22, 3, 4, 5, 0)
+
+
+@freeze_time('2000-07-02 03:04:05')
+def test_time_date():
+    test_string = "12:24 01.02.2011"
+    result = atdate.parse(test_string)
+    assert result == datetime(2011, 2, 1, 12, 24, 0, 0)
+
+
+@freeze_time('2000-07-02 03:04:05')
+def test_isodatetime():
+    test_string = '2011-09-22T11:44'
+    result = atdate.parse(test_string)
+    assert result == datetime(2011, 9, 22, 11, 44, 0, 0)
+
+
+@freeze_time('2000-07-02 03:04:05')
+def test_isodatetime_without_t():
+    test_string = '2011-09-22 11:44'
+    result = atdate.parse(test_string)
+    assert result == datetime(2011, 9, 22, 11, 44, 0, 0)

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov freezegun
pip install pipenv
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/destag/at-date.git@3957d0b750ef1205adb0ba2fc3dccf34c3f0ce62#egg=atdate
attrs==22.2.0
certifi==2021.5.30
coverage==6.2
distlib==0.3.9
filelock==3.4.1
freezegun==1.2.2
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig==1.1.1
lark-parser==0.12.0
packaging==21.3
pipenv==2022.4.8
platformdirs==2.4.0
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
pytest-cov==4.0.0
python-dateutil==2.9.0.post0
six==1.17.0
tomli==1.2.3
typing_extensions==4.1.1
virtualenv==20.17.1
virtualenv-clone==0.5.7
zipp==3.6.0

name: at-date
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - coverage==6.2
      - distlib==0.3.9
      - filelock==3.4.1
      - freezegun==1.2.2
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - lark-parser==0.12.0
      - packaging==21.3
      - pipenv==2022.4.8
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - python-dateutil==2.9.0.post0
      - six==1.17.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - virtualenv==20.17.1
      - virtualenv-clone==0.5.7
      - zipp==3.6.0
prefix: /opt/conda/envs/at-date

test/test_atdate.py::test_isodate test/test_atdate.py::test_isodatetime test/test_atdate.py::test_isodatetime_without_t
test/test_atdate.py::test_at_date_has_parse_attribute test/test_atdate.py::test_at_date_has_atdateparser_attribute test/test_atdate.py::test_parse_return_datetime_object test/test_atdate.py::test_at_noon_before_noon test/test_atdate.py::test_at_noon_after_noon test/test_atdate.py::test_at_noon_month_change test/test_atdate.py::test_at_noon_year_change test/test_atdate.py::test_at_midnight test/test_atdate.py::test_at_midnight_month_change test/test_atdate.py::test_at_midnight_year_change test/test_atdate.py::test_at_now test/test_atdate.py::test_at_now_next_minute_change_minute test/test_atdate.py::test_at_now_next_minutes test/test_atdate.py::test_at_now_next_minute_change_hour test/test_atdate.py::test_at_now_next_minute_change_day test/test_atdate.py::test_at_now_next_hour test/test_atdate.py::test_at_now_next_day test/test_atdate.py::test_at_now_next_week test/test_atdate.py::test_at_now_next_month test/test_atdate.py::test_at_now_next_year test/test_atdate.py::test_month_number_day_number test/test_atdate.py::test_month_name_day_number test/test_atdate.py::test_month_number_day_number_year_number test/test_atdate.py::test_day_number_month_number test/test_atdate.py::test_day_number_month_number_year_number test/test_atdate.py::test_inc_period test/test_atdate.py::test_hr24clock_hr_min test/test_atdate.py::test_hr24clock_hour_minute test/test_atdate.py::test_wallclock_hr_min_am_pm test/test_atdate.py::test_wallclock_hour_minute_am_pm test/test_atdate.py::test_next_month_without_now test/test_atdate.py::test_plus_one_day_without_now test/test_atdate.py::test_time_date
docs/README.md atdate/api.py atdate/atdate_format.py
docs/README.md atdate/api.py atdate/atdate_format.py