Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

datetime

Convert Year/Month/Day to Day of Year in Python

August 14, 2022 by Magenaut

I’m using the datetime module, i.e.:

Categories Python, Q&A Tags datetime, python Leave a comment

How to check if the current time is in range in python?

August 14, 2022 by Magenaut

I need to check if the current time is in timerange. The most simple case time_end > time_start:

Categories Python, Q&A Tags datetime, python, range Leave a comment

Extract day of year and Julian day from a string date

August 14, 2022 by Magenaut

I have a string "2012.11.07" in python. I need to convert it to date object and then get an integer value of day of year and also Julian day. Is it possible?

Categories Python, Q&A Tags date, datetime, julian-date, python Leave a comment

Python speed testing – Time Difference – milliseconds

August 14, 2022 by Magenaut

What is the proper way to compare 2 times in Python in order to speed test a section of code? I tried reading the API docs. I’m not sure I understand the timedelta thing.

Categories Python, Q&A Tags datetime, python, time, time-measurement Leave a comment

How to get current time in python and break up into year, month, day, hour, minute?

August 14, 2022 by Magenaut

I would like to get the current time in Python and assign them into variables like year, month, day, hour, minute. How can this be done in Python 2.7?

Categories Python, Q&A Tags datetime, python, python-2.7, time Leave a comment

Pythonic way to combine datetime.date and datetime.time objects

August 14, 2022 by Magenaut

I have two objects that represent the same event instance — one holds the date, the other the time of this event, and I want to create a datetime object.

Categories Python, Q&A Tags datetime, python Leave a comment

How to get day name from datetime

August 14, 2022 by Magenaut

How can I get the day name (such as Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday) from a datetime object in Python?

Categories Python, Q&A Tags datetime, python Leave a comment

How to add/subtract time (hours, minutes, etc.) from a Pandas DataFrame.Index whos objects are of type datetime.time?

August 13, 2022 by Magenaut

I’ve got a DataFrame who’s index is just datetime.time and there’s no method in DataFrame.Index and datetime.time to shift the time. datetime.time has replace but that’ll only work on individual items of the Series?

Categories Python, Q&A Tags datetime, pandas, python, time Leave a comment

How do I round datetime column to nearest quarter hour

August 13, 2022 by Magenaut

I have loaded a data file into a Python pandas dataframe. I has a datetime column of the format 2015-07-18 13:53:33.280.

Categories Python, Q&A Tags datetime, pandas, python, python-datetime Leave a comment

How to calculate difference between two dates in weeks in python

August 13, 2022 by Magenaut

I’m trying to calculate the difference between two dates in “weeks of year”. I can get the datetime object and get the days etc but not week numbers. I can’t, of course, subtract dates because weekends can’t be ensured with that.

Categories Python, Q&A Tags datetime, python Leave a comment
Older posts
Newer posts
← Previous Page1 … Page17 Page18 Page19 Page20 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress