datetime

Tutorials on Python’s datetime module for handling dates, times, and timezones.

Python Project: Build a Log Parser CLI (Regex + argparse)

This Python log parser project takes five separate skills you have met one at a time, regular expressions, dataclasses, the Counter, datetime, and argparse, and welds them into a single command line tool you would actually reach for at work. Server logs are where a lot of real debugging starts, and by the end of this post you will have a tool that reads a ten thousand line access log and answers real questions about it in under a second. ... Read More

ML: Feature Engineering, Turning Raw Data into Predictive Power

Feature engineering turns raw columns into predictive power. This guide shows you how to build interaction terms, polynomial features, datetime extractions, binning, log transforms, and domain-specific features that lift model performance, with every example run on real data. “Coming up with features is difficult, time-consuming, requires expert knowledge. Applied machine learning is basically feature engineering.” Andrew Ng, Stanford CS229 Last Updated: July 2026 | Tested on: Python 3.14.6, scikit-learn 1.9.0, Pandas 2.3.3 | Difficulty: Intermediate | Reading Time: 16 minutes ... Read More

Python: Datetime and Time (Dates, Timezones, Formatting)

You stored a user’s signup time as plain text, the app shipped, and now a customer in Pune swears they signed up “yesterday” while your logs say “today”. Welcome to dates and times. The Python datetime module is how you stop guessing: it gives you real date objects, clean formatting, safe parsing, time math, and timezones that actually behave. “Storing a time without its timezone is like writing down a phone number without the country code. It looks fine until ... Read More