Category "datetime"

Kubernetes logs dump for some time range

Is it possible to obtain Kubernetes logs for a dedicated time range? All I can do right now is to make a dump of about the last-hour log for the single pod usin

Convert string to date using arrow python

I'm trying to convert string to date using arrow module. During the conversion, I received this error: arrow.parser.ParserMatchError: Failed to match '%A %d %B

Calculate the difference in days between two date fields

I have a problem. I have two date fields fromDate and toDate. The toDate also contains a timestamp, e.g. 2021-03-22T18:59:59Z. The problem is that I want to cal

Python get months start and end dates for a given year

I want to write a python function to get months start and end dates for a given year. Sample Input : 2021 Expected output : [(01-Jan-2021,31-Jan-2021), (01-Feb-

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