Professor Falken wrote:Dropping back by here in case anyone else finds this string later also looking to strip leading zeros off of single digit days and/or hours ("May 3" instead of "May 03", or "5:45 pm" instead of "05:45 pm") as I was. Dave's script above works, but it turns out there is a way to do it right from the date formatting.
I found this more robust list of date/time formats, and it includes options for both of those (%e and %l, respectively). These do seem to be working in Indigo. The one for lowercase am/pm (ironically the uppercase %P) doesn't work for me. I haven't tested any of the other ones on this list.
https://linux.die.net/man/3/strftime
Platform specific directives: The full set of format codes supported varies across platforms, because Python calls the platform C library's strftime() function, and platform variations are common. To see the full set of format codes supported on your platform, consult the strftime(3) documentation.
Users browsing this forum: No registered users and 1 guest