Category "datetime"

Weird timezone issue with pytz

>>> import pytz >>> pytz.timezone('Asia/Hong_Kong') <DstTzInfo 'Asia/Hong_Kong' LMT+7:37:00 STD> A seven hour and 37 minute offset? Th

Convert HH:mm to UTC date time in JavaScript using date-fns

I'm working on an appointment booking React app where a teacher can set their virtual office hours in the form of a time slot. let availability = ["09:00", "17:

Newbie powershell argument issues

I made powershell script that [1] accepts 2 arguments (aka parameters), [2] changes a file's modified date & time, and [3] writes something to host. The fo

Convert a short DateTime string with date and time to DateTime

Having trouble with my Android project here trying to convert a string of DateTime into an actual DateTime object. here's the code I wrote: string strDateTime =

Getting the average value of each hour for specific columns in data frame

I have a data frame with the date/time passed as "parse_dates" and then set as the index column for the data frame. Flow Enter Leave

Convert into DateTime format ISO8601

I am receiving the input date as below. 2022-05-05 18:08:13.311951 +0:00 And I am trying to convert this to below format which follows ISO8601 format. 2022-05-

How to import DateTimeFormatOptions in

I want to store a DateTimeFormatOptions for date.toLocaleString() to use in multiple places in my app. I defined it like: export const timeFormat = { month: 'nu

Get records that are a time interval away from a given date and specific conditions on a pandas DataFrame

Let it be the following Python Panda DataFrame: | ID | date | direction | country_ID | |-----------|-------------------------|----

Date and time with time zone

My datetime looks like this: date_time = "2022-02-17 08:29:36.345374" I want to convert this to another timezone, the API which I am using have a info of for

Keep getting "ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()."

data_df.loc[data_df['hotelID'] == sqlIDs[neededId] & to_integer(df.iloc[row, 6]) >= to_integer(MostRecent)] This is the snippet that keeps getting me th

Finding datetime object in pandas df column

I have the following code, where I want to determine if a datetime object exists in a data frame. Here is the code: df_grid['Date'] = pd.to_datetime(df_grid['Da

Datetime parse and format in C++

I'm using time_point the first time. I want to parse datetime from string and found a difference when returning back to string from 1 hour. std::chrono::system_

ParquetSharp's UTC adjustment

I am trying to use the ParquetSharp library (https://github.com/G-Research/ParquetSharp) to write some Parquet files from an SQL server database. As the origina

SQLite-net-pcl Comparing Dates

As stated in the question I am attempting to do a date comparison for tasks that are done within a specific date range. My model has a boolean called "Done" and

Pandas rolling average of a columns of dates

I'm trying to calculate the rolling average of a column of datetime objects. In my scenario, the input data are the last day below freezing each year for ~100 y

How to extract date out of string using date time

if for example I have a string like this import datetime as datetime string = "Hello todays date is 11/02/2022 thanks" How may I use datetime to extract just t

Recurring Event between date range in JavaScript

Basically, I need to create an Event, every event will be associated with the fields startDate and endDate. "name": "First Event", "teamName": "Team A",

Python: Order Dates that are in the format: %B %Y

I have a df with dates in the format %B %Y (e.g. June 2021, December 2022 etc.) Date Price Apr 2022 2 Dec 2021 8 I am trying to sort dates in order of oldest

How to set up only time in date-fns and still keep the timezone in javascript

I currently have the following use case: User receives a date in UTC from the backend This date is transformed into local time for displaying purposes The date

How to remove outliers from the list of timedelta objects? Python 3

I have a list of timedelta objects like timedelta(seconds=345) and I need a pythonic way to remove outliers from it. For instance I may have: timedelta_list = [