Skip to content

Magenaut

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

date

How to print a date in a regular format?

August 21, 2022 by Magenaut

This is my code:

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

How to calculate number of days between two given dates

August 21, 2022 by Magenaut

If I have two dates (ex. '8/18/2008' and '9/26/2008'), what is the best way to get the number of days between these two dates?

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

How do I get the day of week given a date?

August 21, 2022 by Magenaut

I want to find out the following:
given a date (datetime object), what is the corresponding day of the week?

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

How to get the last day of the month?

August 21, 2022 by Magenaut

Is there a way using Python’s standard library to easily determine (i.e. one function call) the last day of a given month?

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

Add missing dates to pandas dataframe

August 21, 2022 by Magenaut

My data can have multiple events on a given date or NO events on a date. I take these events, get a count by date and plot them. However, when I plot them, my two series don’t always match.

Categories Python, Q&A Tags dataframe, date, pandas, plot, python Leave a comment

Iterating through a range of dates in Python

August 21, 2022 by Magenaut

I have the following code to do this, but how can I do it better? Right now I think it’s better than nested loops, but it starts to get Perl-one-linerish when you have a generator in a list comprehension.

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

How to subtract a day from a date?

August 21, 2022 by Magenaut

I have a Python datetime.datetime object. What is the best way to subtract one day?

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

Convert Excel style date with pandas

August 20, 2022 by Magenaut

I have to parse an xml file which gives me datetimes in Excel style; for example: 42580.3333333333.

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

Creating a range of dates in Python

August 20, 2022 by Magenaut

I want to create a list of dates, starting with today, and going back an arbitrary number of days, say, in my example 100 days. Is there a better way to do it than this?

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

Adding days to a date in Python

August 20, 2022 by Magenaut

I have a date "10/10/11(m-d-y)" and I want to add 5 days to it using a Python script. Please consider a general solution that works on the month ends also.

Categories Python, Q&A Tags date, datetime, python, timedelta Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 Page4 … Page13 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