so i have this line of code here
ir_sequence_date = str (fields.Date.today())[:10]
I don't understand what's the use of [:10] , does anyone have a clue what it's for?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
so i have this line of code here
ir_sequence_date = str (fields.Date.today())[:10]
I don't understand what's the use of [:10] , does anyone have a clue what it's for?
To display only Date and not show time in that case will use. Example, 29/05/2020 date contain only 10 digits.
Hi,
This will give you first 10 letters of the corresponding string. Suppose if str (fields.Date.today()) is abcdefghijkl and if you do str (fields.Date.today())[:10] , the result will be abcdefghij (first 10) .
Thanks
관련 게시물 | 답글 | 화면 | 활동 | |
---|---|---|---|---|
|
1
5월 20
|
5038 | ||
|
3
10월 23
|
8848 | ||
|
1
9월 23
|
3338 | ||
|
1
5월 23
|
2286 | ||
|
2
4월 23
|
2840 |
Please use a meaningful title.