How to get datetime from server

18 views
Skip to first unread message

Thiago Luiz Parolin

unread,
Sep 6, 2018, 12:08:31 PM9/6/18
to django...@googlegroups.com
Hi,
I am building a django system that prevent user from upload a file after a date.
This date is setting using:
today = datetime.date.today()

but if the user alters his computer date, he can upload file normally after the end date.
how can i assing to 'today', the date from server and not client computer?

Thanks
--
Thiago

Thiago Luiz Parolin

unread,
Sep 6, 2018, 12:08:50 PM9/6/18
to django...@googlegroups.com
Sorry, my mistake!
In manage.py runserver, the server is my computer and the time displayed is my computer time.
Putting the code in production server all work as expected!

--
Thiago Luiz Parolin

ireoluwa fakeye

unread,
Sep 6, 2018, 12:13:12 PM9/6/18
to django...@googlegroups.com
It's better you import from django.util 

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANbmKys-Yfc0JeZNaa3uG0hribKrUBN3PDGA-HAegxN2%2BBM69Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages