Last active
February 19, 2022 18:45
-
-
Save kbro237/cc70b228ee8d0834b8290b2c46524045 to your computer and use it in GitHub Desktop.
pretty_date.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pythonista for iOS script | |
from dateutil import parser | |
from datetime import datetime | |
import sys, clipboard | |
def make_pretty(input_date): | |
dt = parser.parse(input_date) | |
pretty_date = dt.strftime('%B %d, %Y') | |
return pretty_date | |
def main(): | |
incoming = sys.argv[1] | |
pretty = make_pretty(incoming) | |
clipboard.set(pretty) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment