Convert given integer to date.

A friend of mine helped my with the first method getYear(). I need another method that will give me the day and month from a given number.

public int getYear() {

int year = 0 ;

int numericDate = integerDate ;

for ( year = 1900; numericDate > ( isLeapYear(year) ? 366 : 365 ); year++)

numericDate -= ( isLeapYear(year) ? 366 : 365 ) ;

return year ;

}

public int getMonth() {

}

public int getDay() {

}

[477 byte] By [eveningsa] at [2007-11-27 1:30:10]
# 1
What is the "number" supposed to be?
ChuckBinga at 2007-7-12 0:30:53 > top of Java-index,Java Essentials,Java Programming...
# 2
> What is the "number" supposed to be?Don't tell us. It's more challenging when we have no idea what your specs are.
DrLaszloJamfa at 2007-7-12 0:30:53 > top of Java-index,Java Essentials,Java Programming...
# 3
I've never regretted losing that "Gregorian date from Mayan Long Count digits" code so much as now.
tsitha at 2007-7-12 0:30:53 > top of Java-index,Java Essentials,Java Programming...
# 4
Isn't there an urban legend about the Mayan calendar coming to an end in 2012,and so an end to the world? Oh yes, my favourite web site: http://www.armageddononline.org/mayan_calendar.php
DrLaszloJamfa at 2007-7-12 0:30:53 > top of Java-index,Java Essentials,Java Programming...
# 5

I am sorry for not being more specific.. basically this method returns the year from a given number. The base date is 01/01/1900. How would I go about developing another two different methods.. one that returns the day and the other that returns the month.

What I want to do is separate year, month, and day from a given number/integer. Example:

public int getYear() {

int year = 0 ;

int numericDate = integerDate ;

for ( year = 1900; numericDate > ( isLeapYear(year) ? 366 : 365 ); year++)

numericDate -= ( isLeapYear(year) ? 366 : 365 ) ;

return year ;

}

If the given number was 366 then the method will return the number "1" which is 01/01/1901.

eveningsa at 2007-7-12 0:30:53 > top of Java-index,Java Essentials,Java Programming...