Skip to Content
मेन्यू
This question has been flagged
1 Reply
2800 Views

How to set my date default value as 05/08/2022??

Avatar
Discard
Best Answer

You can do it as below:

my_date = fields.Date(string='My Date', default=lambda self: fields.Date.context_today(self).replace(day=8,month=5,year=2022))

Avatar
Discard
Author

It's working, where we can define the specific date format like DD/MM/YYYY

You can change it from Languages, Enable developer mode then Go to Settings -> Translations -> Languages -> open your language and edit the date format field to %d/%m/%Y

Author

I tried the same but date showing 2022-05-08

You need to refresh the page. Which screen you check it?

Related Posts Replies Views Activity
1
जून 25
1611
3
जुल॰ 25
3258
1
मई 25
1398
1
मई 25
1647
4
मई 25
2814