Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
3 Respostas
2355 Visualizações

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?

Avatar
Cancelar

Please use a meaningful title.

Melhor resposta

To display only Date and not show time in that case will use. Example, 29/05/2020 date contain only 10 digits.

Avatar
Cancelar
Melhor resposta

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

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
mai. 20
4976
3
out. 23
8715
1
set. 23
3287
1
mai. 23
2234
2
abr. 23
2779