Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
2358 Visualizzazioni

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
Abbandona

Please use a meaningful title.

Risposta migliore

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

Avatar
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mag 20
4983
3
ott 23
8718
1
set 23
3291
1
mag 23
2235
2
apr 23
2780