Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
2326 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
4954
3
říj 23
8682
1
zář 23
3261
1
kvě 23
2225
2
dub 23
2767