DateTime Field

    0

    1

    Django Public Recipes

    This code creates a new DateTimeField object. The auto_now and auto_now_add options determine how the DateTimeField object behaves. The auto_now_add option allows the field to automatically update its value when a new date and time is entered into the field. The auto_now option causes the field to always use the current date and time as its value.

    Library: django

    Shortcut: django.field.datetime

    fieldName = models.DateTimeField(auto_now=False, auto_now_add=False)
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.