Questions tagged as 'datetime'

2
answers

Validating date and time

As I do so that in the date field, not saved a date that has passed, for example the one of yesterday and in the hour field do not enter an invalid time, for example 27:00, only the Brazilian hours. Both fields are MaskedTextBox . Date...
asked by 03.07.2016 / 02:08
1
answer

Compare two date attributes in the database with two TextBox

How can I compare a range of two dates? data_Inicio date data_Fim date textbox_inicio textbox_fim I'll be able to do this soon on the ASP.NET side, and the goal is that my start date is never less than my end date and my end date is never...
asked by 24.11.2014 / 14:54
2
answers

Comparing only the DateTime field date in C #

I need to compare only the date of two fields DateTime . DateTime aux = new DateTime(2016, 09, 02, 10, 0, 0); if (aux.Equals(DateTime.Now)) { //Alguma ação... } In the code above, I need to enter if when the date (09/02/20...
asked by 02.09.2016 / 15:38
3
answers

Java time counting seconds in real time

I want to show the system time and the seconds counting in real time in Java.     
asked by 08.01.2015 / 16:16
3
answers

Date does not receive value more than 30 days

I'm having a code that I want to check if the date is greater than 30 days with the JodaTime, but putting in the console output the value is not assigned. I have seen the following: link And I did the same idea, but it still did not work....
asked by 29.09.2017 / 17:19
1
answer

Add () 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'm using the DateTime method to add a TimeSpan, but it's not working because the time is se...
asked by 05.07.2017 / 15:51
2
answers

Working with a DateTime instance without the time information

My tests had been running successfully, when "by magic" one of them began to fail: var data1 = DateTime.Now.AddDays(1); ...processos ...processos var data1 = DateTime.Now.AddDays(1); Assert.Throws<DataException>(() =>...
asked by 21.11.2015 / 02:24
1
answer

Skip to next business day if the date falls on a weekend

In PHP, I have a certain date, coming from the database, which is the date a request was made. I need to add 5 business days to this date, which is the deadline for the request to be delivered. At this count I need to ignore the weekends....
asked by 27.07.2016 / 17:41
1
answer

How to save user-supplied date in MySQL?

I have a form that has a field where the user's date of birth is entered, this field has a datepicker that already returns the date in year, month, day format, this date is accessed through $_GET['birthdate'] its format is strin...
asked by 07.02.2015 / 13:51
1
answer

Error date_diff PHP

I am doing a test, with an Oracle database query (writing sysdate, result: 13/09/2016 13:24:44) and returning me in PHP. I need to calculate the difference in hours and I was trying the function below: $date_a = new DateTime($p_fim[$passo]); $...
asked by 13.09.2016 / 18:43