Skip to content

Tag: datetime

Pandas: Get year to date dates from previous year

I want to compare the dates ranging from January 1st till the current day, from this year versus from last year. example: get the rows with dates ranging from january 1st till november 29th 2020 get the rows with dates ranging from january 1st till november 29th 2021 here is what I have tryed doing, and the o…

adding tzinfo for naive datetime cause strange offset?

I’m just trying to add tzinfo for my datetime object (with no specific time). I have date in str format, and timezone in str format. I created this function: all looks fine when I am using tzinfo like: “Etc/GMT-6”: but look at this: Why do I get such a strange values like 03:19, 05:18 when i…