Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created August 30, 2020 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/6b6ffefc2babf97166303ff59d47d1c6 to your computer and use it in GitHub Desktop.
Save amankharwal/6b6ffefc2babf97166303ff59d47d1c6 to your computer and use it in GitHub Desktop.
# Import all the code from myfunc.py as my.
import myfunc as my
# Need dates in this code
from datetime import datetime as dt
# Some simple test data.
string_date="12/31/2019"
# Convert string date to datetime.date
print(my.to_date(string_date))
today = dt.today()
# Show today's date in mm/dd/yyyy format.
print(my.mdy(today))
dollar_amt=12345.678
# Show this big number in currency format.
print(my.to_curr(dollar_amt))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment