• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to dynamically update the week ?

 
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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???
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
well any answers for this its really important and urgent to me guys.....
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
That feels good. Thanks. Here's a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic