Questions tagged as 'date'

2
answers

Is it possible to have month 13 on a date in Java?

I was looking at the documentation for class Formatter of Java 7, on this link of Oracle itself , when I noticed the following example below: What intrigued me was the example given for the month formatting option, m : which...
asked by 23.04.2015 / 21:08
2
answers

How to humanize a date in PHP

How to humanize a date in PHP? For example, from that date 2015-08-20 , I want the function to return Há uma semana , because it's strange to read something like foi publicado há 754 dias or publicado há 38 semanas .   ...
asked by 30.08.2015 / 00:19
3
answers

How to compare dates in PHP?

I would like to know what function I use to compare two dates and return to larger ones. I have a form for HR registration in which the user will register their professional experiences being that the date of entry into employment can not be...
asked by 22.09.2014 / 20:55
3
answers

Add days to a date

I need to add another 2 days on a date from a variable. I'm doing it this way but it's not working. $data = '17/11/2014'; echo date($data, strtotime("+2 days"));     
asked by 17.11.2014 / 14:38
4
answers

How do I know if a particular day is a weekend?

How do you know if an informed day, of the current month, fell on the weekend? For example: echo isWeekend(24) // True echo isWeekend(26) // False In the related topic below, I can know today using the date method: date('w') But...
asked by 26.07.2016 / 14:59
2
answers

Calculate difference between dates

I need to calculate the difference between the date of registration and the current date, if it is greater than 6 months, return Boolean. I am registering the bank on the date of registration as follows: public static final String DATE_FORMAT_...
asked by 15.11.2015 / 16:08
2
answers

How to calculate the time of each year between two dates?

I need to get two dates and calculate the time period of each year in isolation . For example: between dates 12/06/2012 and 12/06/2017 the correct output would be: 2012 = 5 meses e 12 dias 2013 = 12 meses 2014 = 12 meses 2015 =...
asked by 19.08.2017 / 22:07
2
answers

GMT returns -0306 instead of -0300, what's the reason?

Locale ptBR = new Locale("pt", "BR"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyy", ptBR); SimpleDateFormat iso = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.sssZ"); GregorianCalendar calendar = new GregorianCalendar(ptBR); String data...
asked by 01.12.2015 / 18:10
1
answer

ORDER BY only day without time

In MySQL I have a column timestamp called dia_cadastr o (2016-06-21 11:27:32), in the query I want to give a ORDER BY only on the day, and disregard the time. That is, if they have products registered the same day, then it g...
asked by 24.06.2016 / 15:07
2
answers

Pick up current machine date

I need when I run the code it takes the current date of the system and assigns a Date . Example: Date x = new Date(now);     
asked by 21.10.2015 / 07:39