Remove time from a date/time string using jQuery

date, jquery, sql, time

Solution

Try this:

$("adopt_date").html(function (index, value) {
    return value.replace(/\d{1,2}:\d{2}(AM|PM)/ig, '');
});

FIDDLE

Problem

What is an efficient way to strip the time from this returned dataset using jQuery? I need the time to exist in the database because of ordering purposes however I need to display only the date. `<adopt_date>Apr 25 2013 2:41PM</adopt_date>` is an example of a result from my Web Service. Here is how I currently usethe information if it helps: `var adopted_date = $(this).find('adopt_date').text();` Where $(this) is dataset. Thanks!

Original source