Monday, August 31, 2015

TIME ZONE DJANGO SAVE DATETIMEFIELD

Hello is the first time I write on the list, I have little time learning Django and presented me a drawback. I have a model called Bill, which has a field called date of sale, and I need to store the date and time of the sale but the client time, and now it is keeping the server time. As I keep the date and time correctly in the model?
I have some variables in established settings:

USE_TZ = True
TIME_ZONE = 'America / Caracas'

/********************models.py   ***********/

class Factura(models.Model):
      fecha = models.DateTimeField()

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e26484b7-13ab-447e-bcb0-6503adf705e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment