Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
2341 Представления

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?

Аватар
Отменить

Please use a meaningful title.

Лучший ответ

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
мая 20
4965
3
окт. 23
8696
1
сент. 23
3264
1
мая 23
2228
2
апр. 23
2771