hi, I use the Django rest framework and there is a problem with time formatting
how can I change the format of time like this
15 مهر ۱۴۰۲ ساعت ۱۵:۲۰
instead of this
1402-12-29T14:41:02.919282+0330
the document said to use
{{ my_date|jformat:"%A %d %B %Y %H:%M" }} {# specific formatting #}
but it is for templates only, I am using the Django rest framework!
here is my model and resializer:
class Post(models.Model):
created_at = jmodel.jDateTimeField(auto_now_add=True)
class PostSerializer(serializers.ModelSerializer):
class Meta:
model = Post
fields = '__all__'
hi, I use the Django rest framework and there is a problem with time formatting how can I change the format of time like this 15 مهر ۱۴۰۲ ساعت ۱۵:۲۰ instead of this 1402-12-29T14:41:02.919282+0330 the document said to use
{{ my_date|jformat:"%A %d %B %Y %H:%M" }} {# specific formatting #}
but it is for templates only, I am using the Django rest framework! here is my model and resializer:
is there any extra setting?