The Artima Developer Community
Sponsored Link

Java Answers Forum
kindly help me to explain this...please

1 reply on 1 page. Most recent reply: Oct 5, 2005 1:21 AM by Carl Asman

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
marjorjie

Posts: 6
Nickname: jorj
Registered: Sep, 2005

kindly help me to explain this...please Posted: Oct 4, 2005 5:52 PM
Reply to this message Reply
Advertisement
hi! i need to make a program that is about dates..

what is lacking is that i dont know how to get the days of the day...

i.e. Wedsday...and so on..

as i browse to the net, i found this format:

yearAsString=Integer.toString(tempYear);
century=Integer.parseInt(year AsString.substring(2,4));

dayPosition = ((26*tempMonth-2)/10+day+yearInCentury
+yearInCentury/4+century/4-2*century)%7;

why does tempMonth is multiplied by 26 and subtracted by 2?
then divided by 10...and so on...

ive already tried this one...and it really works...

but the problem is, i can't explain on how this stuff works..

Or if ever you too can't explain this, do you have any suggestions on how to get the DayOfTheWeek without using the BUILT IN java class...

thanks to all!!!


Carl Asman

Posts: 3
Nickname: freelancer
Registered: Oct, 2005

Re: kindly help me to explain this...please Posted: Oct 5, 2005 1:21 AM
Reply to this message Reply
How to calculate the day of the week is a well known algorithm, google on it and you will soon find it.

--
M.Sc. in Computer Science
Freelancing software engineer
visit http://www.edlin.org to contact me regarding software projects

Flat View: This topic has 1 reply on 1 page
Topic: Problem in displaying unicode Character Previous Topic   Next Topic Topic: days of the week....

Sponsored Links



Google
  Web Artima.com   

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