Converting Strings to Dates with strptime Now write it in lowercase:Īs you can see, with these formatting codes you can represent the date-time in just about any form that you'd like. In this example we have used the format code %Y. Let us display the year: print(x.strftime( '%Y'))
0 Comments
Leave a Reply. |