# TypeError: fromisoformat: argument must be string

**URL:** <https://forum.djangoproject.com/t/typeerror-fromisoformat-argument-must-be-string/14807>\
**Category:** Mystery Errors\
**Created:** [July 15, 2022, 6:09am UTC](https://forum.djangoproject.com/t/typeerror-fromisoformat-argument-must-be-string/14807 "2022-07-15T06:09:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![devilBoiii](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/devilboiii/32/9276_2.png) [@devilBoiii](https://forum.djangoproject.com/u/devilBoiii)\
**Post date:** [July 15, 2022, 6:09am UTC](https://forum.djangoproject.com/t/typeerror-fromisoformat-argument-must-be-string/14807/1 "2022-07-15T06:09:19Z")

</div>

Hello guys  
Please any great ones…I need help to solve this error of mine.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/7/709a56f9a7d46fb4bb2635a07f70ecbeefb7301f.png)

---

<div class="post-metadata">

**Author:** ![run\_the\_race](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/run_the_race/32/4822_2.png) [@run\_the\_race](https://forum.djangoproject.com/u/run_the_race)\
**Post date:** [July 15, 2022, 10:31am UTC](https://forum.djangoproject.com/t/typeerror-fromisoformat-argument-must-be-string/14807/2 "2022-07-15T10:31:35Z")

</div>

Post the full stack trace of the error, and the line of code with some context where it last left your code (before the stack trace moved to the datetime). Also show us how you imported datetime.

I looks like its an error in the `to_python` for the `now` field, thats the part where it takes the field from the POST, and converts it to a python type. Its expecting a string, but its a type that is not a string. Maybe its getting an epoc count offset. `print type(request.POST['now']) `to see what type its getting.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 15, 2022, 11:03am UTC](https://forum.djangoproject.com/t/typeerror-fromisoformat-argument-must-be-string/14807/3 "2022-07-15T11:03:09Z")

</div>

Also, please don’t post images of code here. Copy/paste the text of the code into the body of your message. Surround the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. (This forces the forum software to keep your code properly formatted - critical with Python.)
