Most voted "datetime" questions
A Datetime object in many programming languages describes a date and an hour of the day. It can express either an instant in time or a position on a calendar, depending on the context in which it is used and the specific application. This tag can be used for any question related to date and time.
Learn more…440 questions
Sort by count of
-
4
votes1
answer3984
viewsTimezone do Brasil para Datetimeoffset C#
I’d like to know what’s possible Timezones available for all regions of Brazil. I saw we got the E. South America Standard Time for Brasília’s time, but for example, what would be the Timezone acre?…
-
4
votes1
answer90
viewsFormat Time using initBinder
I need to catch the time with the "hh:mm" format but it is not working, follow the error also to better specify: Whitelabel Error Page This application has no Explicit Mapping for /error, so you are…
-
4
votes2
answers465
viewsHow to change the JSON serialization format of PHP Datetime?
In PHP, when I use a json_encode on an object of the type DateTime, it displays the following result: $date = new DateTime(); echo json_encode(compact('date'), JSON_PRETTY_PRINT); Exit: { "date": {…
-
4
votes2
answers6030
viewsCompare dates in Python
Good afternoon ! I need to solve the following scenario in python: I have one or more files . txt in a folder, but I want to return only the files that have the modification date according to the…
-
4
votes3
answers4376
viewsCurrent date and time in time zone timestamp format
How can I print this date in timestamp format with time zone (timestampz)? from datetime import datetime, timedelta current_time = (datetime.now()) Upshot: 2019-03-28 15:14:19.108116 I would like…
-
4
votes3
answers1332
viewsFormat DATETIME SQL Server
I wonder if you have any way to change the Datetime format in SQL Server EX: 2019-07-09 11:42:00 for 09-07-2019 11:42:00
-
4
votes3
answers1018
viewsConvert to date type 'yyyy-mm-dd'
I have a problem trying to modify the type of date that appears to me in two columns of a table of mine. This is my code: declare @top10reclamacoes varchar(max) declare @html varchar(max) declare…
-
4
votes1
answer76
viewsData to string conversion
I’m developing a project and I’m having a problem with a date-to-string conversion (I believe that’s it). I am counting months between a date and another (algorithm obtained in this other question,…
-
4
votes2
answers129
viewsWhat is the difference between LINQ research forms with Datetime.Now?
I am running two code snippets and they are giving different results. Does anyone know why? This code shows coupons only that have the validity of the current date and time + 3h (I don’t know why):…
-
4
votes1
answer681
viewsGet the current date and time here from Brazil to enter in the database
I have a table that records the login and logout of users on the system. However, when the login is done, the date and time stored are not being added according to the time zone of Brasilia. Follow…
-
4
votes2
answers1326
viewsHow to work with timezones without using a timestamp?
I was reading that answer, of the Stack Overflow in English, and I came across the following excerpt: For Mysql (or Mariadb), if you don’t need the time information consider using the DATE column…
-
4
votes1
answer56
viewsHow to catch the 29th of February php datetime
I do not know if it is a bug, I searched, I did not find it. But today, I need to recover a data from a month ago and to my surprise it happened this: $dateTime = new DateTime(); print_r($dateTime);…
-
4
votes1
answer61
viewsDate count of days when it has turn of year
I’m having trouble generating an iteration where dates are displayed from a given day to the most current day. this problem happens when it has the "turn of the year" and I put a condition of…
-
3
votes1
answer62
viewsHow to display a layout in the Homescreen Widget for each day of the week?
I would like to show certain layout in the Homescreen Widget for each day of the week. I have the 5 days, and when identifying them, the device should update the widget layout. How could I do it?…
-
3
votes1
answer3636
viewsConvert timestamp value to date
I have a value timestamp one-date, 1389135600, how can I convert this value to a date of this kind 27/12/2014.
-
3
votes1
answer278
viewsI get NA when I convert Character to time (Posixlt)
Why do I get NA when I do this conversion from Character to Posixlt? library(bReeze) data(winddata) tempo <- winddata[,1] tempo[1:6] # Preview # [1] "06.05.2009 11:20" "06.05.2009 11:30"…
-
3
votes1
answer891
viewsTrigger that calculates and updates age
I want to create a Rigger that when firing calculates the customer’s age on each table row and updates itself. I tried it this way: create trigger Atualiza_Idade on cliente for insert,update,delete…
-
3
votes1
answer549
viewsHow to pass dates in Java to a database?
I’m trying to pass a date in format "yyyy/MM/dd HH:mm:ss" to the database for this I am using the Date() and the SimpleDateFormat(), but he returns me one string. Is there any way he can return me a…
-
3
votes1
answer114
viewsReturns the previous month of an informed date in Qt
How do I return the previous month of the date reported in Qt, has some function in the QDate what does it do? I just found the one that adds addMonths. Example: month 04 reported returns month 03.…
-
3
votes1
answer145
viewsConvert.Changetype converts data incorrectly
The method Convert.ChangeType is converting the date the wrong way I hope 24/02/2015 and comes 23/02/2015. Does anyone know why? Code example: using System; using System.Globalization; namespace…
-
3
votes3
answers917
viewsFormatting String with Dateformat using a Timezone is not working
In my web service, there is an endpoint that returns a timestamp to me UTC and I have a method that generates a date formatted from this timestamp: formatDate(1432313391, "UTC"); public String…
-
3
votes3
answers2918
viewsFormat a string with time
I’m trying to format a string that already has date and time, but this string just gotta get the time I’m trying this way but it doesn’t work: Recovering from Data Base. string dtSolicitacao =…
-
3
votes2
answers937
viewsHow to add multiple date ranges as php
I have a problem with the sum of dates. I have several events that are registered in the bank with initial date and final date, I need to know the time interval between these events and add up these…
-
3
votes1
answer39
viewsHow to check time entry and cancel calculation when come blank
I’m calculating the difference between two times using datetime, but when a time is not filled I need him to do no calculation (the result needs to be 0 or NULL), but he calculates considering…
-
3
votes6
answers3209
viewsHow to turn string into time in PHP?
I have 2 strings that represent times. How to calculate the difference between the two. $string1 = "12:04:32"; $string2 = "18:07:34";
-
3
votes1
answer2296
viewsFormat date on Android and Sqlite
I am having difficulty in making the process of setting the current date of my Sqlite database in the type attribute java.util.Date of my object. The Sqlite date comes in "yyyy-MM-dd" format. I am…
-
3
votes2
answers253
viewsHow to work with a Datetime instance without the time information
My tests had been passing successfully, when "by magic" one of them started to fail: var data1 = DateTime.Now.AddDays(1); ...processos ...processos var data1 = DateTime.Now.AddDays(1);…
-
3
votes2
answers652
viewsConvert a date to Java
Good Afternoon. How do I convert a date into Java, taking into account the date entered may be day-month-year or year-day-month. I have the following code: data = toDate('2015-10-01'); function…
-
3
votes2
answers16833
viewsHow to obtain only the date, without the time, of a Datetime?
Converting a field using ToDateTime it brings the date and time. parcelamento.data_vencimento = Convert.ToDateTime(reader["data_vencimento"]); Is there any direct conversion to bring only the date…
-
3
votes4
answers1125
viewsRun PHP function to insert data into DB daily at specific times
I am creating a "module" of my system and now I have to create a function that, when arriving at the time that is in the database, run a insert. For example, if the schedule is in the table 22:00,…
-
3
votes1
answer5140
viewsConvert string to Calendar
Well I need to do a String to Calendar conversion and I have to set the value in a variable (that is in type Calendar) in a class and then insert the data in a database! System.out.println("Digite a…
-
3
votes2
answers17826
viewsHow to select in date format?
How do I select using dates on SQL server 2008? When I do a search with this select: select * from NOME_TABELA where DATA_FISCAL between '2016-05-01' and '2016-05-11' The result is 12 records…
-
3
votes1
answer284
viewsHow to get the time in seconds of a date in string format?
I know the function time(0) me returns the seconds since the first of January 1970, in case the user would enter a date (dd-mm-yyyy or in any format due to system limitation) and the system would…
-
3
votes1
answer91
viewsPHP date_diff error
I am doing a test, with a query in Oracle database (recording sysdate, result: 13/09/2016 13:24:44) and returning me in PHP. I need to calculate the difference in hours and was trying the function…
-
3
votes2
answers914
viewsTime difference Timespan in 24hrs format
I am asking this question because I have not located any topic with my problem, which is very similar to others. I have 2 fields TimeSpan? one of which relates to check-in time and the other to…
-
3
votes2
answers1191
viewsDoing operations/handling Datetime
The idea is for the user to type in a textbox to horaEntrada and in another to horaSaida where in the case of these two variables they should have the format "HH:mm" hours and minutes only…
-
3
votes1
answer149
viewsAdd() method does not add Timespan to Datetime
I created a Datetime with some values started in the constructor, but when I add a Timespan with some values, it does not add together with the date. I am using the Datetime method to add a…
-
3
votes1
answer9941
viewsReturning difference between days and months
I am developing a C# function that calculates the interest applied to a given account. for this it is necessary to know the correct difference between days and months. How is it possible to execute…
-
3
votes2
answers2000
viewsGenerate and format dates with Moment in Nodejs
I’m trying to use the Moment for formatting dates this way YYYY-MM-DD HH:mm:ss and would like to determine a period between 00:00:00 yesterday and 23:59:59 today. Example: considering today as…
-
3
votes2
answers5347
viewsKnow how many years, months, days, hours, etc have passed since a certain date
I would like to know how do I make the output of the difference between two dates stay the way I want, in this case I would like it to be: Since 16 - 07 - 2014 23:00:00 passed: X years, Y months, K…
-
3
votes1
answer253
viewsHow to calculate days, ignoring the hours?
How can I calculate if spent 1 day ignoring the hours. Explaining, it would be more or less like this: I have a date 2017-09-09 11:45:20, normally it would have been a day when the 11:45 the other…
-
3
votes3
answers54
viewsDate does not receive value more 30 days
I have a code that I want to check if the date is over 30 days with Jodatime, but putting in the console output the value is not assigned. I saw the following:…
-
3
votes1
answer65
viewsLost date format
I need to assemble a condition to subtract a day from the date, for example I created a new column in the database and I need to fill it, the condition to fill it is the following, I’ll take the…
-
3
votes2
answers4339
viewsDifference between start date and end date with Moment js
I need to inform how much time I have of a certain chronometer, I have the date of the moment at which I started the event. I’m developing with angular 4 typescript and use plugin Moment js In my…
-
3
votes1
answer162
viewsHow to convert /Date(1533524400000-0300)/ to PHP
I receive as return from a JSON the date in this format: /Date(1533524400000-0300)/ How to Connect to a DateTime in PHP?
-
3
votes1
answer97
viewsWhy does PHP no longer parse dates with "BRST"?
BRST stands for "Brasilia Summer Time" Before version 7.0.26, PHP parsed the following string: $date = new DateTime("Mon Jan 01 20:00:00 BRST 2017"); After this release, PHP returns: Fatal error:…
-
3
votes1
answer3255
viewsCalculate difference between dates in days on the R
How do I calculate the difference between dates and have the result in days? I have a column in my table called input with data similar to the ones shown below: Entree 2017-01-27 2017-06-01…
-
3
votes1
answer2159
viewsHow to generate Timeformatter in YYYY-mm-Ddthh:mm:ss-TZ format
I got the string 2018-09-26T10:36:40-03:00 and would like to convert her to LocalDateTime. DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy'T'HH:mm:ss'Z'");…
-
3
votes1
answer867
viewsHow to filter time in a datime field in eloquent?
How can I compare if a time is equal to a time stored in a column datetime using the Eloquent?
-
3
votes1
answer93
viewsWhat exactly is the Datetime::createFromImmutable() method for?
What exactly is the method for DateTime::createFromImmutable()? Implemented according to the release note of version 7.3.0 of PHP.