Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Date problem  RSS feed

 
Soumya Ghosh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have to take a date from user.
Then I have to display the past four dates of the user given date.

I am using this---but, here error is given in monthvariablename.
Calendar xmas = new GregorianCalendar(yearvariablename,Calendar.monthvariablename,datevariablename)
session.putValue("temp",xmas);
Calendar t=(Calendar)session.getValue("temp");
t.add(Calendar.DATE, -5);
System.out.println(t.getTime());

or what is the solution?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no field called "monthvariablename" in the Calendar class. What are you trying to accomplish with that line? What are yearvariablename and datevariablename?
 
Soumya Ghosh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I am using that yearvariablename or monthvaraiblename for taking input from user.
I am separately taking date,month and year from user. So, I am passing this.

Ultimately I have to take a date from user and I have to display past four dates of the user given date.
I also have to pass those dates through session so that I can access that in future anywhere.

What is the procedure of doing this?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"contactSoumya Ghosh",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted, often without warning

thanks,
Dave
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do those 3 variables get the proper values that the user enters? Unless they do already, I would concentrate on that, instead of thinking about the session storage.

Why was there a "Calendar." in front of monthvariablename?
[ January 01, 2007: Message edited by: Ulf Dittmer ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!