How to Get the Current Year, Month, and Day as Integers in Python 3 using the datetime Module

Currently working on a project where I need to get the current year, month, and day as integers in Python 3, and noticed that the #1 ranked Google search result for my search resulted in an old answer written in Python 2. While I guess it’s not really a big deal, here is my updated Python 3 code (nothing is different other than the print statements, lol):

import datetime
now =

How to Get Year, Month, and Day as Integers from an ISO 8601 Formatted Date String in Python 3 with dateutil

I’m currently working with the Plaid Banking API and need to convert the ISO 8601 formatted date strings returned by the API into easy to work with integers. While I considered writing my own code to handle this, after a quick Google search I found that this is quite easy to do in Python using the dateutil module. So far I’ve only run this code in the web based programming environment, but I believe this module can be easily installed with the pip package manager by running something like:

$ pip install python-dateutil

The code snippet below mostly comes from a blog post on titled How to convert datetime to and from ISO 8601 string, but I did add the parts which I needed specifically (year, month, day):

import dateutil.parser
# Datestring in ISO 8601 format
datetime_str = "2019-01-23T06:17:59.273519"
# Convert to datetime object
some_datetime_obj = dateutil.parser.parse(datetime_str)
# Get Year, Month, and Day as integers
view raw hosted with ❤ by GitHub

MoneyPhone Support

Dear User,

My name’s Topher Pedersen, founder and developer of MoneyPhone Personal Finance. If you are in need of support, first try simply pressing the nifty chat icon in the bottom right hand corner of the app. Or if the matter is more urgent, simply give us a call–

Support Line: +1 (469) 261-0727

Or send us an email–


Best regards,

Topher Pedersen, founder @ MoneyPhone


How to Post Source Code on Your WordPress Blog using GitHub Gists and the GistPress WordPress Plugin

  1. Download
  2. Install the GistPress Plugin on Your Blog
  3. Copy & Paste the Link to Your GitHub Gist in Your Blog
How to Post Source Code on Your WordPress Blog using GitHub Gists and the
GistPress WordPress Plugin:
1) Download
2) Install the GistPress Plugin on Your Blog
3) Copy & Paste the Link to Your GitHub Gist in Your Blog
while (true) {
alert("Creating programming related blog posts just got a lot easier!");

MoneyPhone Privacy Policy

Privacy Policy

Your privacy is important to me. It is  my (Topher Pedersen) policy to respect your privacy regarding any information I may collect from you on my app, MoneyPhone.

I only ask for personal information when we truly need it to provide a service to you. I collect it by fair and lawful means, with your knowledge and consent. I also let you know why I am collecting it and how it will be used.

I only retain collected information for as long as necessary to provide you with your requested service. What data I store, I will protect within commercially acceptable means to prevent loss and theft, as well as unauthorised access, disclosure, copying, use or modification.
I don’t share any personally identifying information publicly or with third-parties, except when required to by law.

My app may link to external sites that I do not operate. Please be aware that I have no control over the content and practices of these sites, and cannot accept responsibility or liability for their respective privacy policies.

You are free to refuse our request for your personal information, with the understanding that I may be unable to provide you with some of your desired services.

Your continued use of my website will be regarded as acceptance of our practices around privacy and personal information. If you have any questions about how I handle user data and personal information, feel free to contact me (

This policy is effective as of 26 June 2019.


# TODO: 3-4 Week Plan for MoneyPhone & the June/July 2019 Pioneer Tournament

  1. Remove the “Yesterday Total Spending” SMS-Text Alert
  2. Stop Counting Pending Payments
  3. Write Code to Account for “Net Money Transfers”
  4. Quit Sending SMS-Text Alerts to Users Which Have Not Yet Linked Their Bank Accounts
  5. Replace Web-App with Landing Page
  6. Launch MoneyPhone for Android
  7. Launch MoneyPhone for iOS
  8. Launch Beta-X Accelerator (and Run YouTube Ads for First Batch)
  9. Acquire Paid Beta Users

UPDATE (6/27/2019): Can cross 1, 2, 4, 5, & 6 off the list.


  • Write Code to Account for “Net Money Transfers”
  • Launch MoneyPhone for iOS
  • Launch Beta-X Accelerator (and Run YouTube Ads for First Batch)
  • Acquire Paid Beta Users


  • Add an event listener that detects whenever the WebView is re-opened and refreshes the app if it has been more than 4 hours.
  • Handle updating spending targets, phone numbers, and toggle switches via ajax without refreshing the entire app


  • Try caching the main login.html page with JavaScript localStorage for seemingly faster login speeds, bypassing the main login screen, and then simply fetch the new data in the background while displaying a little spinner wheel in the navbar.
  • Consider re-designing the app
  • Add all the cool new features that I want (fixed expenses, new stats/metrics)

Apache-Cordova/PhoneGap Application Error net::ERR_CONNECTION_REFUSED (

Hello there distraught Apache-Cordova/PhoneGap developer! Quick post here on the blog to help you with this horrible error message. If you happen to be trying to link up your Apache-Cordova/PhoneGap application running in an Android Emulator to a local development server, such as the builtin Python/Flask development server, and have already made sure to enable the cordova-plugin-whitelist, your problem (and solution) is simple: you cannot link up a cordova app running in an emulator to a local development server running at Instead, you need to use a tool like ngrok to give your local development server its own public web address such as which will then make your local development server accessible to your cordova app.

Please note however, I suggest paying the $60 per year for the ngrok basic subscription so that you have a stable web address that doesn’t change. If you try to accomplish this using their free service, you are going to be in for quite the headache constantly changing the url in your codebase every time you run ngrok!

Hope this post helps some other poor souls out there on the interwebs. This bug caused me quite the headache this afternoon. However, I’m feeling much better after figuring out the solution. And shout out to the guys at ngrok. God bless you!