Category "datetime"

How to validate Date Start and Finish Overlap from a list of items

What I have A list of objects with Id, DateStart and DateFinish. [ { Id: 1234567890, DateStart: new DateTime(), DateFinish: new Date

Formatting DateTime in ASP.NET Core 3.0 using System.Text.Json

I am migrating a web API from .NET Core 2.2 to 3.0 and want to use the new System.Text.Json. When using Newtonsoft I was able to format DateTime using the code

How to match Datetimeindex for all but the year?

I have a dataset with missing values and a Datetimeindex. I would like to fill this values with the mean values of other values reported at the same month, day

Perform a merge by date field without creating an auxiliary column in the DataFrame

Be the following DataFrames in python pandas: | date | counter | |-----------------------------|------------------| | 2022-01-0

How do I convert numpy.datetime64('2022-04-20T00:00:00.000000000') to datetime.date(2022, 4, 04)

I have a column df['Date] which is a datetime64[ns] type and after doing the sheets= sorted(df['Date'].unique(), reverse =True) I get a numpy.datetime64('2022-

How to compare just the date or just date time ignoring seconds in a Python Pandas dataframe column of mixed data types?

In a pandas dataframe, I have a column of mixed data types, such as text, integers and datetimes. I need to find columns where datetimes match: (1) exact values

Check if page creation date is within the last 7 days with Eleventy and Nunjucks?

I posted a few days ago about having a way to check for newly created posts, and I am making some headway in this but got a little stuck as shortcodes are still

How to set start day time to particular time in momentjs

I'm trying to set the start time of the day to a particular time. currently, in momentjs, I can get startOf day like this let now = moment() console.log('now'

ZPL - how to insert dateTime string in QR code?

I have ZPL like this, it prints a QR code ^XA ^FO50,100 ^BQN,2,5,Q ^FD Hello world! Some data Printed on: dateTimeString ^FS ^XZ What to put in place of date

Dart/Flutter DateTime difference inDays error for March 31 April 1

I am trying to get the difference in Days between two dates picked from a DatePicker. This works fine except for ONE single date : March 31. The difference in

How to sample a python df on daily rate when it is greater than 500 yrs

I need to sample a dataframe that has a date range of 100 years at a daily rate because I want to get yearly totals (so I thought resample at daily rate then su

ForeignKey error in ormar has no attribute 'get_column_alias'

I'm testing out ormar to avoid having to create models for both api and database and ran into an issue with foreignkey assignment I can't seem to figure out. Th

Plotly chart is a mess of lines after index converted to pandas datetime

My plotly chart is just a mess of zig-zagging lines (see chart here). This only happens after I use df['Date'] = pd.to_datetime(df.index) to convert the index t

Datetime + String from a Pandas table into a new table. One line of code

I'm a beginner at python. I'm moving specific cells/scalars from one Dataframe to another. I'm trying to work out why my first block of code didn't work but my

JS how to add hours and minutes to scheduled date

I need to be able to let clients schedule a certain type of meeting for a future date, the meeting duration I get back from the database is in minutes. I need t

(Python) Convert float to datetime

I have a dataset like this: df = pd.DataFrame({'name': ['Amy', 'Chris', 'Sam'], 'date': [1.597104e+12, 1.600906e+12, np.nan]}) print(df) name date

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:",