Remove TimeStamp From Date Datatype

25 08 2007

warghhhh..why are date datatypes such a headache?! :(

Tis was the easiest way i could think off without using some gungho algorithm :D Date -> String -> Date

// format current date (without time) and convert to string
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
String todayDate = formatter.format(new Date());
Date formattedDate = null;
try {
// convert date string back to Date datatype
formattedDate = formatter.parse(todayDate);
} catch (ParseException e) {
log.error("Parse today date error");
}


Actions

Information

2 responses

6 11 2007
Nick

Hi! I’m trying to remove the timestamp from my wordpress blogs. Will this code do that, and where do I paste it?
Thanks!

-Nick

7 11 2007
phoenixblue

hi,
i’m afraid this code is for java. i’m not sure if u can remove timestamp from wordpress blogs but there are some themes that you can use that comes without it..

Check out for the list of themes
http://en.forums.wordpress.com/topic.php?id=1703&page&replies=6#post-19934

Leave a comment