![]() ![]() > import datetime > import zoneinfo > paris_tz = zoneinfo. None of this is true in a time zone aware environment: ![]() You also consider that a date is a lot like aĭatetime, except that it’s less accurate. If you’ve always used naive datetimes, you probably believe that you canĬonvert a datetime to a date by calling its date() In the meantime, for backwards compatibility, the datetime is considered toīe in the default time zone, which is generally what you expect. Please refer to the migration guide for tips on this process. This indicates that you haven’t finished porting your codeįor time zone support. When time zone support is enabled, the database layer expects to receive ![]() I see lots of RuntimeWarning: DateTimeField received a naive datetime (YYYY-MM-DD HH:MM:SS) while time zone support is active – is that bad? This function returns the currentĭate and time as a naive datetime when USE_TZ = False and as an awareĭatetime when USE_TZ = True. Independently of the value of USE_TZ, you may findĭ() useful. If you’re writing a pluggable application that’s expected to work Generally, the correct solution is to change your code to use an aware
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |