How to Convert Dates to UTC in TypeScript?

Date to UTC conversion in TypeScript

I was recently working on a feature that needed to sync date and time data across users in different time zones. There, I noticed that times were showing up inconsistently depending on where the user was located. In that situation, I had to convert all dates to UTC (Coordinated Universal Time) to keep the date … Read more >>

Create Custom Types from Enum Values in TypeScript

Create Custom Types from Enum Values in TypeScript

As a developer working on a project for a US-based company, I recently faced a challenge where I needed to define a set of related constants and use them to create custom types. TypeScript enums proved to be the perfect solution, allowing me to write more readable, maintainable, and type-safe code. In this tutorial, I … Read more >>

Format Dates in TypeScript as YYYY-MM-DD

Formatted date in TypeScript using YYYY-MM-DD format

When working with dates in TypeScript, formatting them into a readable or standardized structure is often necessary, especially for storing in databases or displaying in user interfaces. One of the most common formats used in web development is YYYY-MM-DD, which ensures consistency across systems and locales. In this tutorial, you’ll learn to format dates in … Read more >>

Check Enum Equality in TypeScript

Check Enum Equality in TypeScript

Recently, while working on a project for a client, I faced a bug because I used the wrong comparison operator. I was comparing two enum values using ==, thinking it would work. But the values didn’t match because one was a number and the other was a string. When I changed the operator to ===, … Read more >>

How to Check if an Object is Empty in TypeScript

Check if an Object is Empty in TypeScript

Whether you are building a complex application for a client in New York or a simple data processing tool for a startup in Silicon Valley, understanding how to determine if an object is empty is crucial for ensuring your code runs smoothly and efficiently. In this tutorial, I will explain how to check if an … Read more >>

Extract Year From Date in TypeScript

Extract year from specific date in TypeScript

Have you ever worked on a feature where you needed to group records by year? I recently faced this while building an internal dashboard using TypeScript for tracking employee onboarding. I was working on an employee management module built with TypeScript, where each employee’s joining date was stored in the system. My task was to … Read more >>

How to Get Enum Key by Value in TypeScript

Get Enum Key by Value in TypeScript

While building an e-commerce admin dashboard in TypeScript, you define an enum called ProductCategory to manage all category types consistently across your app. This enum helps when filtering, tagging, or assigning categories to products during development. However, fetching product data from an external API returns only the category value (not the enum key). So, in … Read more >>

How to Add Minutes to a Date in TypeScript?

Update date by adding minutes in Typescript

While working on a feature to send timed reminders, I needed to add a few minutes to a given date in my TypeScript app. For this, I first tried using the built-in setMinutes method, but soon realized it could lead to issues when reusing the original date object. I explored other approaches to avoid this … Read more >>

How to Use TypeScript Enums in Classes

Use TypeScript Enums in Classes A Complete Guide

While developing an online shopping application, a developer needs to manage different order statuses, such as Pending, Shipped, Delivered, and Cancelled. To keep the code clean and consistent, they create a TypeScript enum called OrderStatus and use it inside a class named Order. In this tutorial, we will learn how to effectively use TypeScript enums … Read more >>

51 Python Programs

51 PYTHON PROGRAMS PDF FREE

Download a FREE PDF (112 Pages) Containing 51 Useful Python Programs.

pyython developer roadmap

Aspiring to be a Python developer?

Download a FREE PDF on how to become a Python developer.

Let’s be friends

Be the first to know about sales and special discounts.