Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to dynamically update the week ?

 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what am trying to ask is,i want to update a website weekly eg;
01/01/03
the next week it should be updated to
08/01/03
i need to display the date and day of that week liek this
day date
mon 01/01/03
. .
. .
the next week it should show like this dynamically
day
mon 08/01/03
.. ..
.. ..
.. ..

need a code for this???
 
Greg Charles
Sheriff
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your question boils down to how to figure out if today is Monday, try this:

On the other hand, if you're asking how to update your website, that depends a lot on your website!
And before you ask, yes, in fact, the Gregorian Calendar is named after me.
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Today dateString would equal "Thu 20/02/03".
 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks guys
but when a person enters that page ,the next week
it should dynamically change it date..
think u guys got what i said..
the date should be changing every week dynamically.
 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the next week it should display like this
date day
08/02/03 monday
09/02/02 tuesday

it goes like this till sunday....
this should repeat dynamically every week
 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
well any answers for this its really important and urgent to me guys.....
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
senthil,
Why do you want to use Java to do this? A simple web page could become complicated this way. Why don't you just use JavaScript to do it? No Java involved.
I think the JavaScript for that is just:
today = new Date();
 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks cindy,
well if we use the code

Date dt = new Date()
we would get the current date only,.
but what i need is if a user enter a page that page should show the current week
i.e
days and its date...
and this should change dynamically every week,when the user clicks the same page...
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This code would get you the Monday of the current week ( disclaimer: code is completely untested )

just format the result using a SimpleDateFormat:

You get the idea,
Jamie
[ February 25, 2003: Message edited by: Jamie Robertson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic