Most voted "date" questions
Date is the representation of a specific point in a calendar, usually represented by a day, month and year, the values of which may vary according to the culture and calendar used.
Learn more…887 questions
Sort by count of
-
1
votes2
answers602
viewsGet the date before an informed one
var date = '2019-01-01'; var d = new Date( date ); d.setDate( d.getDate() ); document.write(d); Returned that: Mon Dec 31 2018 22:00:00 GMT-0200 (Brasilia daylight saving time) How do I now return…
-
1
votes1
answer29
viewsGenerate subsequent month in R
How do I place the following month? df1 dt nome idade 01/03/2018 ll 15 07/03/2019 dd 33 31/12/2019 ff 44 After rules df1 dt nome idade 01/03/2018 ll 15 01/04/2019 dd 33 01/01/2020 ff 44 The rule is…
-
1
votes1
answer73
viewsRead Dates file and count days elapsed in the year
I am trying to make a program that opens a file and calculates the days elapsed from the date. The dates are in the file as follows: 30-10-2018. But I’m having trouble with the output that is…
-
1
votes1
answer70
viewsPrint dates 15 days forward from a start date
I have this code that I printed out the dates stipulating the beginning and the end between them: How would I make the system calculate 15 days after the $dateStart? For example: If that was the…
-
1
votes2
answers2506
viewsChange only hours, minutes, seconds of a Date object
I need to change only the hours of an object of the type Date, preserving the day, the month and the year. I tried with the setMinutes(), setSeconds(), setHours(), but appears "is deprecated".…
-
1
votes2
answers2506
viewsChange only hours, minutes, seconds of a Date object
I need to change only the hours of an object of the type Date, preserving the day, the month and the year. I tried with the setMinutes(), setSeconds(), setHours(), but appears "is deprecated".…
-
1
votes1
answer1547
viewsHow to change the date format from "year/month/day" to "year/month" in R?
Suppose I have a date in the standard English format "ymd", example: Sys.Date() "2019-04-11" Since for my analysis I do not need this date to have the days and I decide to remove them, so that it…
-
1
votes0
answers46
viewsProblem with Where
I’m using Mariadb and I have a clause problem WHERE bank. The query is inside Excel that brings me database periods through the month filter. But I was asked to change it to a time period, only it’s…
-
1
votes1
answer6569
viewsHow to join the lines of two Dataframes with Python?
Hello! I need to join lines of two dataframes with python - pandas. For example, let’s say I have these two dataframes X | Y | Z 1 | 2 | 3 4 | 5 | 6 and A | B | C 7 | 8 | 9 0 | 0 | 0 now I need to…
-
1
votes0
answers23
viewsListing dates with primefaces
I’m listing dates using convertDateTime, the problem is this way it always presents the day before what is being read database. Without the convertDateTime it presented the correct date.…
-
1
votes2
answers3235
viewsFormat Localdate and pass as Parameter
I have a Method: private void tratarIFMandato(String [] d){ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); LocalDate dt1 = LocalDate.parse(d[0].trim(), formatter);…
-
1
votes1
answer490
viewsData with PHP + SQL doing operations
I have some questions: I need to save two dates in the same database table, and I will need to do a function to compare the dates later. Actually I already have a test of it ready, but I thought I…
-
1
votes2
answers215
viewsSplitting a string into an array of strings from the occurrence of a date
I need to separate a string, similar to the example below, into an array of strings starting from the event time date and event code (e.g.: 03/07/2019, 15:43 -104) and ending until the next…
-
1
votes1
answer1062
viewsHow to convert a string to Date with the month name in English
I have a df in which the first column dates (13-mai-2019) is as string and I want to convert her to 13-Maio-2019 or 13-5-2019. I used the following code: df['Date'] = pd.to_datetime(df['Date'],…
-
1
votes1
answer340
viewsHow to insert a date into an SQL and Java tuple
I tried to insert a date into a tuple in SQL but I couldn’t, using the Calendar.getInstance() I can only get the current date, but I want to choose another date to add. public class Prova { private…
-
1
votes1
answer826
viewsHow to filter data in a data.frame using a certain amount of time in R?
Suppose I have one data.frame four-column: print(Dados) CLIENTE QTDE VALOR$ DATA_COMPRA 1234 2 50 2019-02-04 4586 1 70 2019-01-17 6535 3 25 2018-12-28 9562 1 150 2018-12-25 3478 7 12 2018-10-12 2684…
-
1
votes1
answer113
viewsRepeat record in database on same day of each month
I need to schedule bills to pay and that every payment would be on a day of each month. I’m doing this, but it’s not working: $hoje = new DateTime($data_hoje); $semana = new…
-
1
votes1
answer66
viewsPut date 5 days in advance
Like, if today is July 14, it’s July 19 and if it was July 30, it’s August 4. teste = new Array ("janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro",…
-
1
votes1
answer209
viewsFunction date shows wrong value of minutes in PHP
I have a problem with the date and time with PHP even defining the region using date_default_timezone_set(America/Sao_Paulo), He’s giving away almost 30 minutes: Follow the code to generate this…
-
1
votes0
answers54
viewsCalculating working days to a date!
I’m doing a product withdrawal system, for example: Certain product category has X working days to be removed. Category | Business days 1 | 1 2 | 3 3 | 4 4 | 3 5 | 3 6 | 3 7 | 4 For example, today…
-
1
votes2
answers1900
viewsCalculate the number of the week within the month
The challenge is to calculate the number of the week within a given month, without using iteration (loops or loops). The goal is to produce a replicable solution for any programming language. It was…
-
1
votes1
answer1540
viewsHow to catch the start and end of the week on Moment.js
I use the following code to catch the start and end of the week. pegaData() { moment().locale(); var agora; var datainicial; var datafinal; agora = moment().format('DD-MM-YYYY'); console.log(agora);…
-
1
votes1
answer79
viewsField returning date in Brazilian standard and the other in American in typescript. How to validate?
I have a field validation problem, in which when the date returns from my API in American format is made the conversion to Brazilian as below: formatDate(date: string) { if (!date) { return '-' }…
-
1
votes1
answer89
viewsError of calculating days interval between two dates using diff in PHP
I am having a difference of values when calculating the interval of days between two dates. I have the following: $data1 = new DateTime('2019-06-10'); $data2 = new DateTime('9999-12-31'); If I use…
-
1
votes1
answer229
viewsHow to make a date filter in Django
I need to do a filter on the views where you bring me the date of the last 30 days. And I’m not sure how to do that.
-
1
votes1
answer993
viewsMoment getting the value of the previous month, even after adding one month
I’m trying to work with the Moment js. var data = moment("2019-08-17", "YYYY-M-D").add('months', 1); alert(data); dia = data.date(); mes = data.month(); ano = data.year(); The alert(data) gives me…
-
1
votes1
answer175
viewsCalculate date without counting weekends and holidays
I’m needing to calculate future dates through a number of days, but you should not count the weekends and holidays. Take the example: The project starts on 01/01/2020 and lasts 25 days, that is, it…
-
1
votes2
answers146
viewsScroll through an array of dates to pick up the amount of monthly records from the last 12 months
I have an array with dates, each date means a new record in the users table, in this case, a new user account created. I need to go through this array to get the amount of accounts created over the…
-
1
votes2
answers108
viewsHelp in python Lists
Good night I’m having a hard time with this: [['1', 0.0, 1.8], ['1', 3.0, 2.0], ['1', 5.0, 1.5], ['1', 6.0, 1.5], ['1', 9.0, 3.0], ['2', 0.0, 1.8], ['2', 1.0, 1.5], ['2', 2.0, 1.5], ['2', 3.0, 2.0],…
-
1
votes0
answers23
viewsJS: Problems with the order of a Dates array
Hello! I’m having trouble in Javascript with the order of an array. Basically, I take a list of objects and sort it according to one of its attributes which is a Date. But when I give a console.log,…
-
1
votes1
answer137
viewsSave a date value in the firestore
I’m trying to save a data value in the firestore, but I’m having a conversion problem when I take the value of a EditText and send it to become a date type value. The attempt I made was this one.…
-
1
votes1
answer1077
viewsNodejs does not respect the OS daylight saving schedule
I set my Timezone in the nodejs for America/Sao_paulo. But it does not respect the tables of the operating system. I use Ubuntu 18.04 LTS + Nodejs V10. The method getTimezoneOffset of Date me…
-
1
votes1
answer34
viewsDate format in Laravel
I’m using Mysql as a database for a project developed with Laravel. However, I need to convert the default date format (YYYY-MM-DD) to the "DD-MM-YYY" format. How can I make this conversion?
-
1
votes2
answers388
viewsCalculate working cut-off date
I have a project in which the user gives a day and a month where he would start some task and the program should, based on some rules, return a final date. Example of rules: maximum running days =…
-
1
votes1
answer79
viewsDatetime with unknown parameters
I am integrating a program with Contaazul and one of the parameters is the date. Their date format is this: "2020-01-08T16:28:59.966Z" To get in PHP this date some parts is quiet, however someone…
-
1
votes1
answer101
viewsData munging with python
Are the following date formats: 042555 04/25/1955 Abril 25, 1955 How to use regex to transform a date format into each other (would be 6 transformations)? For example: Entrada: 042555 Saída:…
-
1
votes1
answer360
viewsHow to format minutes using Java Localdatetime
I am beginner in Java and my doubt is in class LocalDateTime. The time is recorded at a certain point in the program. When I have write on the screen, appears like this: And I need you to come up…
-
1
votes1
answer66
viewsFind equal names(string) in two distinct dataframes and add a column in the second data frame with another data from the first
Hello. I have two data frames: Times with 629 lines. rank prev_rank name league off def spi 0 1 1 Manchester City Barclays Premier League 3.34 0.24 95.24 1 2 2 Liverpool Barclays Premier League 2.95…
-
1
votes1
answer97
viewsThe following Parameters must be Valid date and format (yyyy-MM-dd’T'HH:mm:ssz): date_of_expiration
Hello. I am creating a payment system via pagseguro, where this system is not letting create billets, because it claims the date. I know the date in style 2020-05-30T21:52:49.000-04:00works, but…
-
1
votes0
answers51
viewsProblem with the xticks - matplotlib
I’m a beginner in the Science data area and I’m developing my solution to the Kaggle Titanic problem (https://www.kaggle.com/c/titanic). At the moment I am creating a visualization to verify the…
-
1
votes1
answer99
viewsMinimum input date value should be today
I have a date type input, and I need it not possible to select date that is not from today back, I tried that way, but I did not have much success: HTML: <input [(ngModel)]="atv.dataini"…
-
1
votes2
answers847
viewsHow many days a week do you have in a month?
Hello, good night! I did a lot of research on the Internet and found nothing concerning this doubt! I would like to get how many days of the week there are within a month using javascript! Example:…
-
1
votes1
answer87
viewsFormat dates including offset
I’m not able to format in this pattern: 2020-10-01T11:34:00.270-03:00. SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); System.out.println(inputFormat.format(new…
-
1
votes1
answer128
viewsAdd 365 days to a date in an input type="date"
I have a problem I have an input that I type a date input format , I wanted to add what was typed + 365 but I can’t get by id nor by class: function somaFerias(){ var Hoje = new Date();…
-
1
votes1
answer79
viewsWrong timezone in JAVA
I’m making an application where I need to show in a graph the real time of the capture of a certain data I tested that code: SimpleDateFormat format = new SimpleDateFormat("hh:mm:ss");…
-
1
votes4
answers72
viewsGet minutes between two times
var dtChegada = "16:40"; var dtPartida = "11:20"; var ms = moment(dtChegada,"HH:mm").diff(moment(dtPartida,"HH:mm")); var d = moment.duration(ms); var s =…
-
1
votes2
answers42
viewsGraph error in R: "invalid color name"
I’m working with the data set starwars, package dplyr. My goal is to create a chart with this data, where the independent variable is the height of the characters, and the dependent is their body…
-
1
votes2
answers69
viewsDifference of Month in Javascript
I’m developing a simple application that calculates the difference between two dates, on the console I can already make the difference between years but I can’t calculate the difference of month.…
-
1
votes1
answer149
viewsSelect data according to a specific time
I am doing a program in which, given the day of the week, the hours and the current minutes, he responds with all the "Doctors" available at that time. Each doctor has a period of care. For example:…
-
1
votes1
answer75
viewsFunction to pick up days of the week
I am making a watch that also shows the days of the week, but I would like to be able to show the value with the full name. I even managed to do this by doing a lot of if, but I wanted to do a…