Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
2808 Zobrazení

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
Zrušit

Please use a meaningful title.

Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
kvě 20
5409
2
říj 25
1641
3
říj 23
9991
1
zář 23
3777
1
kvě 23
2770