Questions tagged [date]
A date is a reference to a particular day represented within a calendar system, and consists of year, month and day. Use for questions about creating, manipulating and storing date information. Use with any relevant language tags.
72,230
questions
0
votes
0
answers
8
views
How to group by time-interval from bottom to top using Pandas resample functionality?
I am working with historic data of some stocks. I want to group data by certain time intervals (like 1hr, 3days, etc). Pandas gives amazing functionality of doing this with very less efforts using ...
0
votes
0
answers
7
views
Changing format of date without using to_char - Oracle
I have to get the max payment date on an invoice and I am having trouble with the date format. I do not need the max in this formula as I am using the format in a reporting tool that is pulling the ...
1
vote
2
answers
18
views
how to calculate date range correctly using arrow in python
I have the small snippet of codes below, I am trying to calculate the number of days between today and yesterday using arrow and make sure the result is accurate.
import arrow
TODAY = arrow.now()
...
0
votes
0
answers
10
views
Generate YYYYMM for each month quarter end between two dates
I want to generate Yearmonth (YYYYMM) for each quarters between two years and associate a rank number for each line.
Date_Begin
Date_End
2021
2023
I retrieve a yearmonthrank as below :
SELECT ...
-4
votes
0
answers
15
views
JDatePicker showing other language for Days and Months is Swing [closed]
J Date Picker is used to pick date in Swing
I did exactly what is mentioned in this tutorial.
https://www.codejava.net/java-se/swing/how-to-use-jdatepicker-to-display-calendar-component#
But instead ...
-2
votes
1
answer
29
views
Python converting Time Format like DD/MM/YYYY to 5 hours ago, 3 days ago, 1 year ago, etc from strftime
Looking for a way to convert time from strftime to ... ago, I looked everywhere on the internet and there is a way to convert ... ago to strftime, so I know it is possible but I'm not sure how to do ...
0
votes
1
answer
23
views
Google BigQuery select max for each day
I have a problem with my BigQuery select, I need to get the max value for the column (students) for each day.
SELECT EXTRACT(DATE FROM timestamp) as date, ARRAY_LENGTH(student_ids) as students from ...
-1
votes
0
answers
31
views
Set MYSQL date format from YYYY-MM-DD to DD/MM/YYYY - Django
I have a Django App with a MYSQL database and wanted to check is it possible to change the date format in MYSQL to accept dates input as DD-MM-YYYY rather than YYYY-MM-DD?
I can change the date fine ...
0
votes
3
answers
24
views
Why I'm getting error like this while printing today's date in python?
This is my imported libraries and code_
import time
import datetime
from datetime import datetime
exp_list = data['records']['expiryDates']
exp_date = exp_list[1]
exp_date = datetime.strptime(...
0
votes
0
answers
30
views
Python: How to convert a series datetime64 to Float - including seconds [duplicate]
I would like to convert a datetime64 variable to float considering minutes and seconds.
My trial 1:
from datetime import datetime, timedelta
def posix_time(dt):
return (dt - datetime(1970, 1, 1)) /...
0
votes
1
answer
26
views
insert a time value in oracle
I create a table like this
CREATE TABLE flights_info
( flight_id number(10) NOT NULL,
Train_no number(10) NOT NULL,
station varchar2(50) NOT NULL,
depature_time date NOT NULL,
arrival_time ...
0
votes
1
answer
25
views
Why I cannot change the value of my variable?
I have 3 components :
The first one is this one :
const App = () =>{
const [date, setDate] = useState(new Date())
return (
<MyComponent date={date} setDate={(mydate) => {setDate(mydate)}} /&...
0
votes
1
answer
16
views
sas: how to informat and format variable names as date
I got a data with some variable names are dates, but it cannot show date format when importing in sas. How can I format them as datetime when they are variable names?
The original Excel data like this:...
0
votes
1
answer
23
views
How to extract csv data based on user input (date range)
I'm a Python beginner, we have to read in .csv data and then extract date ranged data (user input). Expected output example below.
How do I loop through the reader and extract the rows within the date ...
-1
votes
2
answers
24
views
Extracting specific dates from strings
I'm attempting to extract some specific dates from text. The text looks like the following:
'Shares of Luxury Goods Makers Slip on Russia Export Ban',
'By Investing.com\xa0-\xa0Mar 15, 2022 By ...
0
votes
1
answer
18
views
Iterating Date in python Dataframe
I realize this is probably a very trivial question but I have a dataframe of 1000+ rows and I want to create a new column "Date" but for a single date "2018-01-31". I tried the ...
-1
votes
1
answer
44
views
Build org.joda.time.DateTime with java.time.LocalDate and java.time.LocalTime or java.time.LocalDateTime
So basically I have a DatePicker and TimePicker which will respectively give me a LocalDate and LocalTime. Now I want to use these values to make a org.joda.time.DateTime variable.
I'm not sure how to ...
0
votes
1
answer
20
views
Get month-day pair without a year from pandas date time
I am trying to use this, but eventually, I get the same year-month-day format where my year changed to default "1900". I want to get only month-day pairs if it is possible.
df['date'] = pd....
0
votes
2
answers
38
views
Date attribute's length in oracle database
The date attribute doesn't show the full value. is there a way to stretch the attribute size?
0
votes
0
answers
28
views
How would you set a date to a specific value in swift? [duplicate]
How would I set a date to a specific time? I am trying to implement notifications into my app and want to set the time for my notification to 12am as a default if the time has not been set. I have a ...
0
votes
0
answers
26
views
Moment Js recur every nth month on first Sunday
I'm trying to generate recurrence for every 2 months on the first Sunday
I have tried this code so far but not getting the expected output
How Do I chain for every nth Month?
let c = moment('05-01-...
0
votes
0
answers
21
views
is there a way to add Date in TextField with some pattern in Java or JavaFX [duplicate]
is there a way to add Date as Text in Text Field like the picture below
there are dash mark cant remove by users to make them just enter date between dash to write a date
0
votes
1
answer
19
views
Convert date and time in dart [duplicate]
from API I am getting this:
"2022-05-12T15:55:03.000000Z"
My question is, how can I make it:
12.05.2022, 15:55
My question is, is here any easy way? Otherwise I can slowly and partially ...
-1
votes
2
answers
32
views
Create a new Date for any specific timezone
I am using Google Apps Script to check and re-format date data from some Google Sheets. But the problem is the result shows the times for the user who run the code. I want to show the date for any ...
0
votes
1
answer
19
views
Convert given UTC timestamp string to unix timestamp
I'm struggling with this small snippet:
import time
from datetime import datetime
start = "2022-05-14T10:00:00"
start_date = datetime.fromisoformat(start)
start_unix = time.mktime(...
0
votes
1
answer
31
views
Find nth week recurrence on week days with moment js
I have just started moment js, I'm trying to generate recurrence for every nth week for defined week days
I have tried this code so far but not getting True for defined week days
// Create a date to ...
0
votes
1
answer
31
views
Caused by error in `as.POSIXlt.character()`: ! character string is not in a standard unambiguous format. How can I change CHR to POSIXCT?
I have a huge data frame called 'cyclist_trip_data_all'
head(cyclist_trip_data_all)
The most important columns of dates have chr class and I need it to be converted to POSIXct for calculations.
...
-1
votes
2
answers
54
views
how to format String to Date with format dd-mm-yyyy in java [duplicate]
I need some support. I desired convert a variable String to Date. The variable Date should be format dd-MM-yyyy.
import java.util.Date;
....
...
String a = "2022-05-12";
...
0
votes
0
answers
23
views
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",
...
0
votes
1
answer
24
views
Find dates with lower revenue than yesterday
I'm fairly new to BQ SQL and am stuck on a query regarding dates.
I have a table that consists of customer_id (int), date_purchase (date), sales (int).
The query is to find all customer_id and ...
-1
votes
1
answer
13
views
Amazon Redshift- How to get start date of the Week from existing daily date field from the table?
I am trying to get start date of the week from existing daily date field from the same table. For example daily dates from 05/08/2022 to 05/14/2022 , the start of the week date output need to come as ...
-4
votes
0
answers
51
views
How can i calculate working days off in java
Im trying to calculate the working days off with some required like:
In a month will work on 2 Saturdays . If this week work on Saturdays . The next week won't work
If this week working on Saturdays:
...
0
votes
0
answers
25
views
Why method print() of my class CustomDateFormatter using with my custom spring annotation is never called?
I have a issue with creation of custom annotation in springboot application:
I've got a form with few fields with datepicker. Dates must have to be parsed in 2 formats "dd/MM/yyyy" or "...
0
votes
1
answer
23
views
AutoHotKey Date Parsing returning today's date
I had been working on a QoL macro to convert selected text dates into a desired format. For that purpose I was trying to utilize the DateParse function that is referenced from the AHK archive forum. ...
0
votes
3
answers
33
views
Order By Date desc evaluates 01-01-1970 higher then everything else
I have the following simplified query
SELECT
id
to_char(execution_date, 'YYYY-MM-DD') as execution_date
FROM schema.values
ORDER BY execution_date DESC, id DESC
execution_date can be null.
If ...
0
votes
0
answers
24
views
How to select date only from database that storing dob as datatype timestamp without timezone in java
I have a table in PostgreSQL that stores dob as datatype timestamp without timezone
example value '1997-12-03 07:00:00'.
My entity class is as follows
@Table(name = "customer")
...
2
votes
1
answer
22
views
Join tables on dates, with dirty date field
In AWS Athena, I am trying to join two tables in the db using the date, but one of the tables (table2) is not clean, and contains values that are not dates, as shown below.
| table2.date |
| ---- |
|6/...
0
votes
1
answer
14
views
Excel problem: Exported from OBIEE to Excel analysis adding time part to a date column
There is a date column used in OBIEE analysis. That column is declared as 'date' datatype in Oracle table, type in rpd is also 'DATE'. However, when exported to Excel, Excel is adding time values to ...
0
votes
2
answers
29
views
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 to be able to create a future start date ...
0
votes
1
answer
41
views
How do I find yesterday's date
I'm stuck on a query regarding dates in Big Query using SQL.
I have a table that consists of customer_id (int), date_purchase (date), sales (int).
The query is to find all customer_id and ...
0
votes
1
answer
21
views
Use date (-1 day) on next row to be the end date for current row
I am trying to self join in my current script in order to find the next row and then whatever day specified it should minus 1 day from it and put that in the end date column for the current row, but ...
1
vote
0
answers
20
views
dataparser with month+year, without day
I want to parse dates of different formats and dataparser seems to be the best option to handle most of weird cases. However, I'm having problem with dates without a day, e.g. "04/2022". I'd ...
-1
votes
1
answer
33
views
update column date to today if any value is modified
I need to modify the column last_update_date to today's date only if any other value of the table Table1 is modified.
The code throws an error if the value to be modified is the column ...
0
votes
0
answers
27
views
Distribution of a time span across months
I a process have a Start date of 1/1/2022 and end date of 3/15/2022, date is in it's own field.
Now I have a field for every Month in the Year: J F M A M etc.
I want to calculate that my process ...
2
votes
2
answers
47
views
R Rolling Counts of Additions, or Deletions, to a List
df <- data.frame(date = as.Date(c(rep("2022-01-01", 3),
rep("2022-02-01", 3),
rep("2022-03-01", 4))...
0
votes
2
answers
28
views
Moment .isAfter not returning correctly while comparing two dates
I've got a problem with fucntion .isAfter(), when it comes to compare "05/04/2022" with "03/05/2022" it tells me that 05/04/2022>03/05/2022
I specified that I want to compare ...
1
vote
1
answer
24
views
How to use `label_date_short`?
How I am using wrongly label_date_short from scales package?
library(tidyverse)
library(scales)
date_taille <- tibble(
Taille = rep(c("taille_hiver", "taille_ete"), times = 2)...
-1
votes
0
answers
19
views
A single layout for different time strings to make time.Parse(layout, str) work in Golang [duplicate]
I have an application which returns time in different timezones e.g
"createtime": "2022-01-20 21:40:59 +0000 UTC" or
"createtime": "2022-05-04 04:30:12 -0700 PDT&...
-4
votes
0
answers
17
views
Js function that reads millisecond
Write a JavaScript function that reads time in milliseconds and will return the time according to the below format. Consider century as the largest unit of time and second as the smallest unit of time ...
1
vote
2
answers
33
views
How to convert "numeric string" to a date object using `as.Date()`?
I have a list of calendar dates in a data frame given in the format:
20000110
20000117
20000124
which standard for 2000-01-10, 2000-01-17, 2000-01-24, etc.
However, using
df %>% mutate(date= as....