Bookmark Topic Watch Topic
  • New Topic

Date Conversion  RSS feed

 
Josweth Reddy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Report post to moderator
Dear Frinds !!

I have a date in dd/mm/yy format.I need to add one year to this date and have to subtract one day.

Im greatful if you post your views/sugestions.

Thanks in advance,
Josweth Reddy T
 
Pravin Jain
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Report post to moderator
In Java for using date we use java.util.Date which is not in any format
like dd/mm/yy... Instead it has information upto milliseconds accuracy
for an instance of time. You could also use java.util.GregorianCalendar
which is a subclass of java.util.Calendar. to represent instances of time.
You have all the required methods in these classes to manipulate like
adding days, months etc. as far as presenting the calue of Date is
concerned, we normally use the java.text.SimpleDateFormat to format
the java.util.Date instance to String format.
Please refer APIs.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question in multiple forums.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!