... フォルトで有効になっています。無効にするには、設定ファイルで USE_TZ = False を設定してください。 タイムゾーンのサポートには zoneinfo を使います。これは Python 3.9 から Python 標準ライブラリの一部となりました。 特定の問題と格闘している場合は、 タイムゾーン ... atetime コンストラクタの tzinfo 引数は、夏時間を含むタイムゾーンでは正しく動作しません。他のタイムゾーンを使用する場合は、 zoneinfo のドキュメントをよく確認してください。 注釈 Python の datetime.time オブジェクトは、 tzinfo 属性を持ちます。また PostgreSQ ... 時オブジェクトを作成するべきです。(DST移行中に日時に適用すべきオフセットを指定するために fold 属性を使用する例については、 zoneinfo ドキュメントの Using ZoneInfo セクション を参照してください。) 実際には、これはめったに問題になりません。Django はモデルや ... ... フォルトで有効になっています。無効にするには、設定ファイルで USE_TZ = False を設定してください。 タイムゾーンのサポートには zoneinfo を使います。これは Python 3.9 から Python 標準ライブラリの一部となりました。 特定の問題と格闘している場合は、 タイムゾーン ... atetime コンストラクタの tzinfo 引数は、夏時間を含むタイムゾーンでは正しく動作しません。他のタイムゾーンを使用する場合は、 zoneinfo のドキュメントをよく確認してください。 注釈 Python の datetime.time オブジェクトは、 tzinfo 属性を持ちます。また PostgreSQ ... 時オブジェクトを作成するべきです。(DST移行中に日時に適用すべきオフセットを指定するために fold 属性を使用する例については、 zoneinfo ドキュメントの Using ZoneInfo セクション を参照してください。) 実際には、これはめったに問題になりません。Django はモデルや ... ... を使用することを 強く推奨 します。 The Django 3.2.x series is the last to support Python 3.6 and 3.7. Django 4.0 の新機能 ¶ zoneinfo default timezone implementation ¶ The Python standard library's zoneinfo is now the default timezone implementation in Dja ... ngo. This is the next step in the migration from using pytz to using zoneinfo . Django 3.2 allowed the use of non- pytz time zones. Django 4.0 makes zoneinfo the default implementation. Support for py ... tz is now deprecated and will be removed in Django 5.0. zoneinfo is part of the Python standard library from Python 3.9. The backports.zoneinfo package is automatically installed alongsid ... ... を使用することを 強く推奨 します。 The Django 3.2.x series is the last to support Python 3.6 and 3.7. Django 4.0 の新機能 ¶ zoneinfo default timezone implementation ¶ The Python standard library's zoneinfo is now the default timezone implementation in Dja ... ngo. This is the next step in the migration from using pytz to using zoneinfo . Django 3.2 allowed the use of non- pytz time zones. Django 4.0 makes zoneinfo the default implementation. Support for py ... tz is now deprecated and will be removed in Django 5.0. zoneinfo is part of the Python standard library from Python 3.9. The backports.zoneinfo package is automatically installed alongsid ... ... 。Django は通常データベースの extract 関数を使うので、データベースがサポートしている lookup_name を使うことができます。通常 zoneinfo によって提供される tzinfo サブクラスを渡すと、特定のタイムゾーンの値を抽出できます。 datetime 2015-06-15 23:30:01.000321+0 ... 00) に変換しています。これにより、返される日、曜日、時間の値が変わります: >>> from django.utils import timezone >>> import zoneinfo >>> melb = zoneinfo . ZoneInfo ( "Australia/Melbourne" ) # UTC+10:00 >>> with timezone . override ( melb ): ... Experiment ... : 9} 明示的にタイムゾーンを Extract 関数に渡しても同じように動作し、アクティブなタイムゾーンよりも優先されます: >>> import zoneinfo >>> melb = zoneinfo . ZoneInfo ( "Australia/Melbourne" ) >>> Experiment . objects . annotate ( ... day = ExtractDay ( "sta ... ... 。Django は通常データベースの extract 関数を使うので、データベースがサポートしている lookup_name を使うことができます。通常 zoneinfo によって提供される tzinfo サブクラスを渡すと、特定のタイムゾーンの値を抽出できます。 datetime 2015-06-15 23:30:01.000321+0 ... 00) に変換しています。これにより、返される日、曜日、時間の値が変わります: >>> from django.utils import timezone >>> import zoneinfo >>> melb = zoneinfo . ZoneInfo ( "Australia/Melbourne" ) # UTC+10:00 >>> with timezone . override ( melb ): ... Experiment ... : 9} 明示的にタイムゾーンを Extract 関数に渡しても同じように動作し、アクティブなタイムゾーンよりも優先されます: >>> import zoneinfo >>> melb = zoneinfo . ZoneInfo ( "Australia/Melbourne" ) >>> Experiment . objects . annotate ( ... day = ExtractDay ( "sta ... ... set , tuple , dict , range datetime.date 、 datetime.time 、 datetime.datetime インスタンス (timezone-aware なものも含む) zoneinfo.ZoneInfo instances decimal.Decimal インスタンス enum.Enum または enum.Flag インスタンス uuid.UUID インスタンス functools.p ... カスタムの deconstruct() メソッドを持つすべてのオブジェクト ( 以下を参照 ) Changed in Django 6.0: Serialization support for zoneinfo.ZoneInfo instances was added. Django は以下のオブジェクトをシリアライズできません。 ネストしたクラス 任意のクラスのインスタ ... ... set , tuple , dict , range datetime.date 、 datetime.time 、 datetime.datetime インスタンス (timezone-aware なものも含む) zoneinfo.ZoneInfo instances decimal.Decimal インスタンス enum.Enum または enum.Flag インスタンス uuid.UUID インスタンス functools.p ... カスタムの deconstruct() メソッドを持つすべてのオブジェクト ( 以下を参照 ) Changed in Django 6.0: Serialization support for zoneinfo.ZoneInfo instances was added. Django は以下のオブジェクトをシリアライズできません。 ネストしたクラス 任意のクラスのインスタ ... ... ons can now themselves be squashed before being transitioned to normal migrations. Migrations now support serialization of zoneinfo.ZoneInfo instances. Serialization of deconstructible objects now supports keyword arguments with names that are not valid ... ... ons can now themselves be squashed before being transitioned to normal migrations. Migrations now support serialization of zoneinfo.ZoneInfo instances. Serialization of deconstructible objects now supports keyword arguments with names that are not valid ... 2026年10月08日