Margin_Walker
asked on
getDayOfMonth() issue
Experts,
I need a date in the format yyyyMMdd using the following:
String valDate_yyyyMMdd = ""+valuationDate.getYear() +""+valuat ionDate.ge tMonth()+" "+valuatio nDate.getD ayOfMonth( )
but it returns 2007127 instead of 20071207
Please help!
Thanks,
Margin_Walker
I need a date in the format yyyyMMdd using the following:
String valDate_yyyyMMdd = ""+valuationDate.getYear()
but it returns 2007127 instead of 20071207
Please help!
Thanks,
Margin_Walker
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
import java.text.*;
import java.util.*;
public class Test
{
public static void main(String args[]) throws Exception
{
DateFormat df = new SimpleDateFormat("yyyyMMdd
Date date1 = new Date(2007-1900, 12-1, 7);
System.out.println(df.form
}
}