This is my views.py
:
class UpdateListMyShipmentView(UpdateView):
model = models.Shipment
fields = []
def get_success_url(self):
return reverse_lazy('request:my_shipment')
def form_valid(self, form):
print(timezone.localtime(timezone.now()))
form.instance.time_finished_shipment = timezone.localtime(timezone.now())
form.save()
return super().form_valid(form)
This is the value of print() method in command line:
2018-06-15 16:54:29.499707+07:00
And this is the result in database after saved value into database:
2018-06-15 09:43:39.025761+00
Why it is different?