DRF-API-Logger icon indicating copy to clipboard operation
DRF-API-Logger copied to clipboard

ValueError at /admin/drf_api_logger/apilogsmodel/ Database returned an invalid datetime value. Are time zone definitions for your database installed? Request Method:

Open TechPradheep opened this issue 1 year ago • 1 comments

I have used in the settings.py Timezone asia india timezone but its throws error but i used UTC Time It works well how to fix the issue Screenshot from 2024-08-09 21-50-52

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'Asia/Kolkata'

USE_TZ = True

GET Request URL: http://127.0.0.1:8000/admin/drf_api_logger/apilogsmodel/ ValueError at /admin/drf_api_logger/apilogsmodel/ Database returned an invalid datetime value. Are time zone definitions for your database installed? Request Method:

TechPradheep avatar Aug 09 '24 16:08 TechPradheep

I faced this same problem. My MySQL database is installed on host and everything is saved in UTC. Django project is running on docker container. If TZ is set in settings file to UTC, everything works OK. TIME_ZONE = 'Europe/Helsinki'

If I change it to 'Helsinki' the error is: ValueError: Database returned an invalid datetime value. Are time zone definitions for your database installed? "GET /admin/drf_api_logger/apilogsmodel/ HTTP/1.1" 500 1172

FG-Samuli avatar Sep 16 '24 12:09 FG-Samuli

Closing due to inactivity.

vishalanandl177 avatar Sep 03 '25 18:09 vishalanandl177

@vishalanandl177 is that issue fixed?

TechPradheep avatar Sep 04 '25 05:09 TechPradheep

The fix is here: https://github.com/vishalanandl177/DRF-API-Logger/pull/111 We'll be part of the next release.

vishalanandl177 avatar Sep 05 '25 11:09 vishalanandl177

Thanks

TechPradheep avatar Sep 16 '25 05:09 TechPradheep