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
-
2
votes1
answer44
viewsReverse transformation in R to var continues with max = Inf
I have the following var continuous: > summary(banco1$rac) Min. 1st Qu. Median Mean 3rd Qu. Max. NA's 0.000 5.077 6.694 17.380 8.728 4917.000 465 This var does not have normal distribution and so…
-
2
votes1
answer1038
viewsCorrect alternative that implements a validator for a date field in Laravel
to. $this->validate($request, [ 'data_nascimento' => 'regex:ddmmyyyy', ]); b. $this->validate($request, [ 'data_nascimento' => 'required|date', ]); c. $this->validate($request, […
-
2
votes3
answers120
viewsConvert String to Date and remove 1 day from String
I got this string: $data_final = "26/11/2017"; And I need this variable to look like 25/11/2017. That is, I need to convert string to date and remove 1 day from that date.…
-
2
votes1
answer4309
viewsSubtract date from datetime
I need to take current date and subtract 3 months. Bang making conversions and subtracting 3 but will go wrong to turn the year, in January for example will result in month -2. I believe that there…
-
2
votes1
answer51
viewsprogram does not catch system date
I have a program that I am doing a test to see how it goes but I could not find the error that makes it does not return the date and time of the system, I thought it was the regex but it is also not…
-
2
votes1
answer680
viewsGson Library Changing useful. Date
When using the library GSON for the manipulation of JSON, I realized that by doing the parsers the date is being changed, it’s tiny, but it’s enough to break my unit test with JUnit. Follow a sketch…
-
2
votes2
answers857
viewsGroup By By Data
I have a table called tsc, with the properties ID and DataHoraOcorrencia. I need to check the amount of ID for DataHoraOcorrecia. SQL SELECT DataHoraOcorrencia as DataHora, COUNT(tsc.ID) as…
-
2
votes3
answers3811
viewsUnparseable date: "2017-10-30T02:00:00.000Z"
I am setting up a register where I pass a date and, when saving, is showing this error: java.text.ParseException: Unparseable date: "2017-10-30T02:00:00.000Z" at java.text.DateFormat.parse(Unknown…
-
2
votes5
answers73
viewsCalculate date difference and print these days
I would like to calculate the difference of two dates and print out all the dates between them, for example: $data_inicio = new DateTime("08-02-2018"); $data_fim = new DateTime("10-03-2018");…
-
2
votes1
answer942
views -
2
votes2
answers786
viewsDifference of months between two dates, without considering the day of the month
I am making an application for labor calculations. I need to receive two dates and know the amount of days/ months/ years. Ex.: from 08/03/2017 to 07/03/2018 is to give 12 exact months, in my code…
-
2
votes1
answer936
viewsMake java.sql.Date object to dd/MM/yyyy format
I got a field that’s like String, where a data in format dd/MM/yyyy , I’m converting to java.sql.Date, the result is: 2018-01-01. What I needed was to get the date in the format : dd/MM/yyyy, which…
-
2
votes2
answers90
viewsValidando fechamento de factura para tipo de compra e venda Javascript e submeter para uma api
I’m a beginner and I’m stuck on the invoice closing validation. I built a list in this format: [ date: '2017-5-9', value: '59.99', type: 'credit', typePag: 1 }, { date: '2017-12-17',value: 'R$…
-
2
votes2
answers2257
viewsSet current date in Input type Date
I want to set the current date in this input type date; using this way with php it only gives the value of the current date, but viewing shows only dd/mm/yyyy, but inspecting the code the value of…
-
2
votes2
answers396
viewsConvert date string to ISO 8601 format (with "T" and "Z")
With a string date in the format 01/01/2018 13:00:40, how I could convert it to ISO 8601 format using the "T" and "Z"? Example: 2018-01-01T13:00:40Z I got it this way: datetime.strftime(…
-
2
votes2
answers724
viewsParsing a timestamp with Timezone
I was making a little code to implement a treatment case in a friend’s application module and got stuck with a problem. This is a unitary test. To put in the application module I would have to make…
-
2
votes2
answers2915
viewsCompare dates using Localdate
I need to make a comparison of dates as follows: dat_envio_shopping + 2 dias úteis < [data hoje] Until then I have done so: boletoSerasa.getEnvio().isBefore(LocalDate.now()) My question is in…
-
2
votes1
answer2791
viewsCheck if date is between two dates in the 30 min range
I have a service that before saving some value in the bank, it is necessary to be checked if it is within some period already saved in the bank. Each period consists of half an hour. ex: 10:00 10:30…
-
2
votes1
answer57
viewsI cannot maintain the format of a date received from a dataframe
I have a dataframe with a date string and another time column: And I want to concatenate the date with the time to stay in the string format "2016-12-25T08:38:00" Initially I was trying this way:…
-
2
votes1
answer31
viewsI need to create a Compound dataset using HDF in C#
My application contains a list of Basicvariables and within each of the BV’s, I have a list of objects of class OPC_UA, which have 3 attributes, a datetime (which I will convert to a timestamp), a…
-
2
votes1
answer104
viewsDo not allow date 50 years back in the database
I have a JSF system and Primefaces 4.0 and I have a field <p: calendar> in which I did the treatment to not load dates in the current day Calendar up to -50 years. But still the user can type…
-
2
votes1
answer1019
views-1 Month does not return to the previous month - PHP
Wore the strtotime() to return to the previous month and always take the last day of the previous month, did so: $data_teste = date('Y-m-t', strtotime('-1 month')); And it was working so far…
-
2
votes2
answers636
viewsMaterialize Autocomplete does not load values
I’m having trouble loading values into the Materialize autocomplete. What happens is the following: $().ready(function() { $('#sel_estado').change(function() { $.post('auto_cid.php',…
-
2
votes2
answers203
viewsdate.getHours with 0 more elegant
I need to assemble a JSON with a property in hours and minutes. I use a Timepicker on the front and it returns a date: Fri Feb 15 2019 05:52:09 GMT-0200 (Horário de Verão de Brasília) To build JSON…
-
2
votes1
answer253
viewsHow to generate a value containing the "last Friday of the month" using Java Localdate?
I am receiving data from a CSV file with some data, and one of these data contains random dates in the following format: mm/YYYY. I have a parameter private LocalDate date. And from the generated…
-
2
votes3
answers3885
viewsJavascript/Jquery - Calculating days between two "DD/MM/YYYY" dates
Friends, good afternoon... next, the code below, takes two dates in a calendar, in the format of DD/MM/YYYY $('.two-calendars').on('pickmeup-change', function (evt) { var range =…
-
2
votes1
answer3485
viewsChange varchar field yyyy-mm-dd hh:mm:ss to data dd/mm/yyyy in SQL Server
Guys, I’m extracting the data from a satisfaction survey log, and I’m trying to create a column with the date format, so I can group the days and months into an Excel dynamic table. For more…
-
2
votes3
answers881
viewsHow to calculate difference of dates that are a previous row with MYSQL?
I have a table where I record the time when a particular request had its status_id changed. This table I call historico_status_solicitacoes. In this table, I have the following fields: id,…
-
2
votes3
answers118
viewsWhere am I going wrong to calculate age?
function idadeAluno($dataNasci){ $nasci = new dateTime($this->dataNasci); $agora = new dateTime(); $idade = $this->nasci - $this->agora; echo 'idade aluno:'.$this->idade.'<br/>'; }…
-
2
votes2
answers1740
viewsComparing datetime with minutes interval
I need to compare 2 dates, these dates are in format %d/%m/%Y %H:%M:%S and one is obtained through the internet, and the other locally, however I am not able to compare the two with an interval of 2…
-
2
votes1
answer125
viewsPHP - Take a value and modify the date day
I have a question about date manipulation. I need to take a value (given by the user) and turn this value into day of the month. Example : $Valor_Usuario = 30; $Data = 12/10/2018; $Resultado =…
-
2
votes1
answer153
viewsHow to let the negative operator after using diff() in php
Good afternoon. I do not know if it was very clear but the following, use date_diff(), the problem is what, when I convert the interval $intervalo = date_interval_format($resultado, '%a') if the…
-
2
votes1
answer84
viewsSum of values of a bd column between a time interval - PHP
include "conexao.inc"; $sql="SELECT * FROM tb_abastece WHERE data BETWEEN ('20/01/2019') AND ('30/01/2019')"; $res=mysqli_query($conexao,$sql); while($vreg=mysqli_fetch_array($res)) { $id=$vreg[0];…
-
2
votes1
answer403
viewsHow to check dates in input datetime?
I have an HTML page with an input date/time and date/time out form (input datetime-local). I need to check on the same page if the fields were filled only with different dates at the time the user…
-
2
votes2
answers806
viewsRegex date validation with 2/2/4 characters
Looking hard, I found some explanations on how to validate date with Regex but my knowledge in regex is a little limited yet. With some modifications in the explanations I found, I came to a nice…
-
2
votes1
answer514
viewsFractions of 15 minutes in the PHP time log
I have a billing system for hours which I am trying to make charges for fractions of 15 min. It takes the difference of the time of entry and exit and adds the remaining time, example: Check-in…
-
2
votes3
answers231
viewsHow to crop a String and convert to int in Java?
How can I cut out the String monthAndYear, convert and assign variables respective? At the time of conversion shows an error. System.out.print("Enter month and year to calculate income (MM/YYYY):…
-
2
votes1
answer138
viewsWhy does my program only work if I avoid parse Try catch?
I get a date from SQLITE but cannot understand where the error is, it is simply not visible. String dateValue = empDatadevolucao.getText() .toString() .trim(); SimpleDateFormat ft = new…
-
2
votes1
answer138
viewsWhy does my program only work if I avoid parse Try catch?
I get a date from SQLITE but cannot understand where the error is, it is simply not visible. String dateValue = empDatadevolucao.getText() .toString() .trim(); SimpleDateFormat ft = new…
-
2
votes1
answer69
viewsFunction to check if the year changes
I have this code that almost works perfectly. I went to do a test, and when it arrives to generate in January, it generates for the same year, example it generated an invoice for 15/12/2019 and has…
-
2
votes2
answers1383
viewsPrint current month and the next two months
I’m taking the current month in number and need to increment it two more months ahead, besides using the current month and saving in a string array. I’m taking the whole and retrieving the name of…
-
2
votes3
answers326
viewsConvert date string without punctuation in Date Javascript format
I am wanting to format a date string without punctuation in a field with date format, for example: sdata = '201909091504' datacorreta = '2019-09-09 15:04' // resultado esperado I tried with the…
-
2
votes2
answers1704
viewsHow to send request in Timestamp: yyyyMMddHHmmssffff format using Postman?
I need to use Postman to send a request to the API and in the header I need to send the date in format yyyyMMddHHmmssffff. I tried to use Moment.js this way, but it doesn’t seem to work: const…
-
2
votes3
answers480
viewsPick the date range separately by weeks of the current month
I need to take the day that starts and ends each week of the current month: 1 - 2019-10-01 to 2019-10-04 2 - 2019-10-07 to 2019-10-11 $today_date = date("Y-m-d"); $currentWeek =…
-
2
votes1
answer487
viewsJavascript bug that subtracts day from -1 and adds time in 2-digit months+days
I was interacting with a calendar component made with pure Javascript, passing an array of dates to the component to select the corresponding dates in the calendar. I noticed that when I sent full…
-
2
votes2
answers238
viewsHow to compare only the date with Date objects?
I want to create a function group that compares dates in Typescript. So far I have the following: function amanhaOuDepois(date: Date): boolean{ if(date > (new Date())) return true; return false;…
-
2
votes1
answer80
viewsJoin columns in ggplot histogram
I have that data https://pastebin.com/9tBv1Enm and tried to make a histogram with x= date and y= count ggplot(ind_geral1, aes(x=mes_ano))+ geom_histogram(binwidth=40) + theme(axis.text.x =…
-
2
votes1
answer170
viewsIntersection between time
I am in doubt about what to use in creating a film simulation project. So far I have a class Sessao: package entidades; import java.time.Duration; import java.time.LocalTime; public class Sessao {…
-
2
votes2
answers120
viewsCapture time range in UNIX
I am trying to capture in UNIX data format the 1 day time range: #!/usr/bin/python # -*- coding: utf-8 -*- import time import datetime from datetime import datetime now = datetime.now() dateNow = ''…
-
2
votes3
answers127
viewsHow to get dates with X days interval?
I have a field data in a table. And every day I will search: SELECT * FROM table WHERE DATE_ADD( data, INTERVAL 7 DAY ) = CURDATE( ) That is, if the date of the table + 7 days is equal to today.…