Hi.

I am a first time user of Joda-Time. I need to output a date in a 
certain format and also add one day to the current day.

I have this code:
DateTime dt = new DateTime();
System.out.println(dt.getYear() + " " + dt.getMonthOfYear() + " "  + 
dt.getDayOfMonth()+1);

The problem is that I need this output to be in a certain format. Like 
yyyy-MM-dd and MM outputs 6 and not 06.
How can I make this happen?

I tried
DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd");
but System.out.println(fmt); only writes the memory allocation :-/

I also tried DateTimeFormatter fmt = 
DateTimeFormat.forPattern("yyyy-MM-dd"); with the same result.

Any suggestions?

Shervin

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to