Hướng dẫn python date yesterday
I need to find "yesterday's" date in this format So for instance, today's date would be represented like this: 111009 I can easily do this for today but I have trouble doing it automatically for "yesterday".
the 20k11 gold badges65 silver badges99 bronze badges asked Nov 11, 2009 at 0:01
Use
answered Nov 11, 2009 at 0:03
Jarret HardieJarret Hardie 91.8k10 gold badges130 silver badges125 bronze badges 2
answered Nov 11, 2009 at 0:04
Nadia AlramliNadia Alramli 107k35 gold badges170 silver badges151 bronze badges 0 This should do what you want:
answered Nov 11, 2009 at 0:03
StefStef 6,5694 gold badges31 silver badges26 bronze badges 2 all answers are correct, but I want to mention that time delta accepts negative arguments.
answered Sep 18, 2017 at 7:21
Iman MirzadehIman Mirzadeh 11.9k1 gold badge39 silver badges44 bronze badges Could I just make this somewhat more international and format the date according to the international standard and not in the weird month-day-year, that is common in the US?
answered Dec 4, 2018 at 12:08
2 To expand on the answer given by Chris if you want to store the date in a variable in a specific format, this is the shortest and most effective way as far as I know
If you want it as an integer (which can be useful)
answered Feb 9, 2017 at 19:18
|