Category "datetime"

How to calculate from a date to another date?

I am creating a workday calendar which calculates which date the workday ends. I have a code that sets daily worktime from e.g 8:00-16:00 (workDayStartStop). An

Getting the start of the day in a different timezone

I have a Date. It is in the local timezone. I want a new Date that is at the beginning of the dayin a different timezone. Here are some things I do not want: A

How can I get the difference between two month-year dates in streamlit?

Here's the thing, I'm building a streamlit app to get the cohorts data. Just like explained here: https://towardsdatascience.com/a-step-by-step-introduction-to-

Removing the time from datetime output (Python)

Remove the time from this code. Current Code: from datetime import datetime, timedelta date = datetime.today() - timedelta(days=1) print("Today's date:",

postgres time conversion hh:mm:ss.us to hh:mm

Using PostgreSQL database for my attendance application. I have a table with IN and out times (hh:mm:ss.us format). When I subtract the times (OUT -IN) to ca

Algorithm to find the most frequent words [closed]

I can't think of an algorithm for my code. Please help me out. We have two files. The first one has text (Text length is n-words). The second

List is printing datetime.datetime

I have a result list that contains something like [(datetime.datetime(2013, 1, 1, 0, 1, 14),), (datetime.datetime(2013, 1, 1, 1, 33, 50),)] How does one prin

Converting datetime only to time in pandas

I would like to ask a question regarding converting datetime only to time. I have values 'Date Created" that include Dates and Times in one column and I would l

Sliding Window Date Range for pandas

Pandas date_range function allows us to make Rolling Windows with a frequency. pd.date_range(start='2019-06-01', end='2019-07-01', freq='3D') # Output Datetim

datetime expected float, got string

I'm trying to make a pyautogui script that adds the users input to the current time using the datetime/timedelta module. I want the pyautogui part to use typewr

datetime expected float, got string

I'm trying to make a pyautogui script that adds the users input to the current time using the datetime/timedelta module. I want the pyautogui part to use typewr

Pandas resample by integration over time with non equidistant data

I have a DataFrame with a Datetimeindex with non equidistant timestamps. I want to get the mean for each hour. But by using resample.mean(), the time distance b

retrieve only months with at least 28 sample days - pandas dataframe

Hello to the people of the web, I have a dataframe containing 'DATE' (datetime) as index and TMAX as column with values: tmax dataframe What i'm trying to do is

ValueError: time data '02/03/2022' does not match format '%d/%m/%y '

How to return values only within a specific date range? I am new to python My code is: for report_date in REPORT_DATE_TYPES:

Python gives wrong result with .seconds attribute of timedelta data

>>>print(today - date, (today - date).seconds) [1] 63 days, 8:45:34.250649 31534 ↑ This is far away from the righ

is there a way to get the unix date and print out all the times of the day corresponding to that day?

In my executable file (tsk_gettimes), it prints out a unix timestamp with every piece of information it prints out in the terminal. I was wondering if there was

Convert datetime to timestamp in Neo4j

How to convert datetime in data loaded in Neo4j to timestamp? Example datetime format: 2020-04-07T12:39:38.027Z Please assist.

Ensure a certain amount of time has elapsed between two tasks in ansible playbook, in real time

I will be notifying users that an event will happen in 15 minutes; I then perform tasks that take a variable amount of time which is less than 15 minutes, and I

Python convert datetime.time to arrow

I need to convert a python object datetime.time to an arrow object. y = datetime.time() >>> y datetime.time(0, 0) >>> arrow.get(y) TypeErro

Python to convert different date formats in a column

I am trying to convert a column which has different date formats. For example: month 2018-01-01 float64 2018-02-01 float64 2018-03-01