Home > Back-end >  Python is how to deal with the date
Python is how to deal with the date

Time:03-17

Python small white want to ask I think excal file a column in the date for example 2002/08/12 can I use the code will he divided into three columns (date) (month) (year)

CodePudding user response:

YourExcelApplication. Cell (x + 1, y). The Value:=YearOf (StringToDate (YourExcelApplication. Cell (x, y). The Value));
YourExcelApplication. Cell (+ 2 x, y). The Value:=MonthOf (StringToDate (YourExcelApplication. Cell (x, y). The Value));
YourExcelApplication. Cell (+ 3 x, y). The Value:=DayOf (StringToDate (YourExcelApplication. Cell (x, y). The Value));
  • Related