Should we use the Date Object in java?

Posted by Jose Conde on Stack Overflow See other posts from Stack Overflow or by Jose Conde
Published on 2010-04-27T23:43:37Z Indexed on 2010/04/27 23:53 UTC
Read the original article Hit count: 373

Filed under:
|

Hi.

Should we use de java.util.Date object in java? It has so many Deprecated methods that is a little anoying to have to use a complex method to something that should be so simples.

I am using something stupid to emulate getDate() like:

    public static int toDayMonth (Date dt)
{
    DateFormat df = new SimpleDateFormat("dd");
    String day = df.format(dt);
    return Integer.parseInt(day);
}

It has to be better way...

© Stack Overflow or respective owner

Related posts about java

Related posts about date