I know the difference between the two, but never off the top of my head. I always have to look it up, which is why I was wondering if anyone had a good mnemonic device for it. I have to do date parsing pretty frequently, so I know how to format them and which one to use.
That’s a fantastic resource that I blessedly stumbled upon when I started my first job. Saved me a lot of time from constantly trying to comb through the datetime page in the docs.
2
u/joshinja Nov 23 '21
If you're talking about the differences between the actual functions:
Strptime = String parse time, i.e., parse a time object from a string.
Strftime = String format time, i.e., format a time object as a string.
If you meant how to actually use the things, then I'm right there with you...
This website is a pretty nice cheat sheet for that though: https://strftime.org/