Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
3 Besvarelser
2379 Visninger

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
Kassér

Please use a meaningful title.

Bedste svar

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

Avatar
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
maj 20
5017
3
okt. 23
8785
1
sep. 23
3319
1
maj 23
2261
2
apr. 23
2818