extract day from Date

Posted by Daniel on Stack Overflow See other posts from Stack Overflow or by Daniel
Published on 2010-04-12T03:14:21Z Indexed on 2010/04/12 3:23 UTC
Read the original article Hit count: 416

Filed under:
|

i receive a timestamp from a soap service in miliseconds.. so i do

Date date = new Date(mar.getEventDate());

how can i extract the day of the month from date, since getDay() and so are deprecated? im using a small hack, but i dont think this is the proper way..

SimpleDateFormat sdf = new SimpleDateFormat("dd");
int day = Integer.parseInt(sdf.format(date));

© Stack Overflow or respective owner

Related posts about java

Related posts about date