The Artima Developer Community
Sponsored Link

Java Answers Forum
GetDate function

1 reply on 1 page. Most recent reply: Jan 31, 2003 11:14 AM by Kishori Sharan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Mike Grammer

Posts: 1
Nickname: spiydr
Registered: Jan, 2003

GetDate function Posted: Jan 31, 2003 10:32 AM
Reply to this message Reply
Advertisement
I need to know how to pass the nextdays date using java. My current function works until I hit the end of the month.
Any help would be appreciated.


Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: GetDate function Posted: Jan 31, 2003 11:14 AM
Reply to this message Reply
Following code will do the work. I don't know how you are getting the date. In case, you get a date and add 1 day to it, you can construct GregorianCalendar object using your date and then call add() method on it.
GregorianCalendar cal = new GregorianCalendar ( ) ;
System.out.println ( cal.getTime() ) ;
cal.add ( Calendar.DATE, 1 ) ;
System.out.println ( cal.getTime() ) ;

Flat View: This topic has 1 reply on 1 page
Topic: Creating a Method Previous Topic   Next Topic Topic: HTTPURLConnection and certificate

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use