Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
2338 Vistas

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
Descartar

Please use a meaningful title.

Mejor respuesta

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

Avatar
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
may 20
4959
3
oct 23
8687
1
sept 23
3264
1
may 23
2226
2
abr 23
2770