Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
5590 มุมมอง

Hello,

I want to write current datetime in excel report using pythons xlwt package.

But it shows the time in UTC format rather than my local timezone. So please help me to solve this problem.

Thanks in advance for your help!!!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Jinesh

you can use below code for get current datetime in excel report.


datetime.strftime(datetime.now(), "%d-%m-%Y")

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด
sheet.write(3, 1, str(date.today()))

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มิ.ย. 23
4344
2
มี.ค. 17
4631
3
มิ.ย. 25
8077
0
เม.ย. 24
1796
4
พ.ย. 23
5840