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 😀 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");
}

Advertisements

Actions

Information

3 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

6 12 2010
Johny

Tried: http://oozman.com/oozing/ideas/archives/oozman-date-remover-wordpress-plugin

It works great for me. Maybe you can try it out.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: