Fixed timezone for date_created

This commit is contained in:
Keannu Christian Bernasol 2023-03-04 22:07:34 +08:00
parent ec74dbdaf5
commit 5c318d6dbb
6 changed files with 83 additions and 35 deletions

View file

@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/4.1/ref/settings/
"""
from pathlib import Path
import pytz
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
@ -112,7 +113,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
TIME_ZONE = 'Asia/Manila'
USE_I18N = True

Binary file not shown.

View file

@ -0,0 +1,22 @@
# Generated by Django 4.1.7 on 2023-03-04 13:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notes', '0011_alter_note_owner'),
]
operations = [
migrations.RemoveField(
model_name='note',
name='date_created',
),
migrations.AddField(
model_name='note',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
]

View file

@ -0,0 +1,23 @@
# Generated by Django 4.1.7 on 2023-03-04 13:58
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('notes', '0012_remove_note_date_created_note_last_updated'),
]
operations = [
migrations.RemoveField(
model_name='note',
name='last_updated',
),
migrations.AddField(
model_name='note',
name='date_created',
field=models.DateTimeField(default=django.utils.timezone.now, editable=False),
),
]