Pranav Indukuri has Published 19 Articles

How to get current time in milliseconds in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 28-Aug-2025 12:23:48

82K+ Views

We can retrieve the current time in milliseconds using different Python built-in modules like time, datetime, and calendar. These modules provide functions to work with time and dates. Each method gives us the time in a different format, but with a little calculation, we can convert it to milliseconds. The ... Read More

How to convert date to datetime in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 28-Aug-2025 12:23:06

41K+ Views

In this article, we will discuss how to convert a date to a datetime object in Python. We use the combine() method from the Date & Time module to combine a date object and a time object into a single datetime object. While the date object represents only the calendar date ... Read More

How to get min, seconds and milliseconds from datetime.now() in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 28-Aug-2025 12:17:24

20K+ Views

Python's datetime module is used to extract various components of the current date and time, such as minutes, seconds, and even milliseconds. The datetime.now() method defined in the datetime module returns the current local date and time as a datetime object. This object allows us to access its individual components ... Read More

How to return the current CPU time in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 28-Aug-2025 12:14:05

5K+ Views

In this article, we retrieve the current CPU time in Python using the time() method,  which is imported from the Python time module. The time module in Python provides various methods and functions related to time. Here we use the time.The time() method to get the current CPU time in seconds. The time ... Read More

How to convert Python date format to 10-digit date format for mysql?

Pranav Indukuri

Pranav Indukuri

Updated on 28-Aug-2025 11:40:05

2K+ Views

While working with databases like MySQL, it’s necessary to store dates in a numeric format, especially for timestamps. MySQL commonly uses Unix timestamps, which are 10-digit numbers representing the number of seconds since January 1, 1970 (known as the epoch). The following are the different methods from the time and ... Read More

How to convert time seconds to h:m:s format in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 28-Aug-2025 11:30:58

8K+ Views

In Python, while working on date and time, converting time seconds to h:m:s (Hours: Minutes: Seconds) format can be done using simple arithmetic operations and built-in modules like datetime and time. The following are several ways to convert time seconds to h:m:s format. Using arithmetic operations ... Read More

How to convert Python DateTime string into integer milliseconds?

Pranav Indukuri

Pranav Indukuri

Updated on 28-Aug-2025 11:13:49

6K+ Views

Python provides the time and datetime modules to convert a DateTime string into integer milliseconds. Key functions include time.time(), which gives the current time in seconds, and datetime.timestamp(), which converts datetime objects directly into seconds since the epoch. By multiplying these values by 1000, we can get the time in ... Read More

How to find what is the index of an element in a list in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 24-Apr-2025 11:46:46

674 Views

In Python, an index is an element's location within an ordered list. Where n is the length of the list, and the first entry has a zero index, and the last element has an n-1 index. In this tutorial, we will look at how to find out the index of ... Read More

How do we assign values to variables in a list using a loop in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 23-Apr-2025 18:02:45

7K+ Views

In Python, lists are a useful way to store multiple elements in a single variable. To assign values to each entry in a list, loops are often needed. This strategy simplifies the process and improves the clarity of your code. This chapter will look at how to assign values to ... Read More

How to match at the beginning of string in python using Regular Expression?

Pranav Indukuri

Pranav Indukuri

Updated on 23-Apr-2025 17:38:20

12K+ Views

A regular expression in Python is a group of characters that allows you to use a search pattern to find a string or set of strings. RegEx is a term for regular expressions. To work with regular expressions in Python, use the re package. Understanding String Matching in Python String ... Read More

Advertisements