Wednesday, October 5, 2022

How to put system date and time in input?

Hi guys!

I need for my project to get the system date and time and put this value inside an input through value.

Well, I tried some methods like:

{% load tz %}

<input value = " {{ value|localtime }} " >

And other ways, however it never works.

I went to test to see if the problem was in the input and value, I put this: <input value = " {{ request.user }} " > and it worked, my user appeared in the input.

What should I do?


Note: In settings.py I put USE_TZ = True

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c9e52cce-0453-48d0-98f3-b88662ca7b90n%40googlegroups.com.

No comments:

Post a Comment