Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
2362 Widoki

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?

Awatar
Odrzuć

Please use a meaningful title.

Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
maj 20
4989
3
paź 23
8724
1
wrz 23
3296
1
maj 23
2238
2
kwi 23
2784