aspose file tools*
The moose likes Java in General and the fly likes how to dynamically update the week ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to dynamically update the week ?" Watch "how to dynamically update the week ?" New topic
Author

how to dynamically update the week ?

senthil sen
Ranch Hand

Joined: Oct 10, 2002
Posts: 184
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

Joined: Oct 01, 2001
Posts: 2851
    
  11

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

Joined: Jul 27, 2001
Posts: 1365

Today dateString would equal "Thu 20/02/03".
senthil sen
Ranch Hand

Joined: Oct 10, 2002
Posts: 184
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

Joined: Oct 10, 2002
Posts: 184
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

Joined: Oct 10, 2002
Posts: 184
hi,
well any answers for this its really important and urgent to me guys.....
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
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();


"JavaRanch, where the deer and the Certified play" - David O'Meara
senthil sen
Ranch Hand

Joined: Oct 10, 2002
Posts: 184
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

Joined: Jul 09, 2001
Posts: 1879

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to dynamically update the week ?