Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
2486 Tampilan

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
Buang

Please use a meaningful title.

Jawaban Terbai

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

Avatar
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Mei 20
5110
3
Okt 23
9034
1
Sep 23
3418
1
Mei 23
2398
2
Apr 23
2963