8
I need to calculate the day of pregnancy a woman is in, taking the information of the date when the woman became pregnant and the date of today.
I have the following instruction:
Date dtToday = new Date(); //pega a data de hoje
Data dtEngravidou = Mommy.getDtPregnantDate(); //retorna a data em que ficou grávida
In theory, I would need to subtract today’s date with the date of pregnancy and I would have the number of days that have passed, so I would have the difference, that is, how many days of pregnancy Mom is.
Your Date is a java.util.Date? Have you considered using a Jodatime?
– Math
It’s java.util.Date. I’ve never heard of this library, I’m new to the java world. You can post an answer as it would be using this Jodatime library?
– rochasdv