/    Sign up×
Community /Pin to ProfileBookmark

Sorting of date and Time.

Hai ,

Can anyone tell how to sort a date and time if it is in Month date year time i.e for example May 23 2006 12:04 AM. Like that.PLease help me to solve this issue of sorting the date with Time.

Hoping for the reply,

Thanking you,
-nectorsol.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMay 26.2006 — I presume you have more than two dates and these dates strings are stored in an array, yes? In which case, you can use a [B]sort function[/B] to provide a custom sort criteria for the array's [url=http://msdn.microsoft.com/library/en-us/script56/html/9bd8b54a-c838-4806-85c8-62eebe6bc48c.asp]sort()[/url] method. In your sort function, you can use the [B]Date.parse()[/B] method to convert that date string to a date object for numeric date comparisons.
Copy linkTweet thisAlerts:
@neochardMay 28.2006 — how about MONTH name? weekdayname? what is the code for that?
Copy linkTweet thisAlerts:
@phpnoviceMay 28.2006 — [url=http://msdn.microsoft.com/library/en-us/script56/html/ed737e50-6398-4462-8779-2af3c03f8325.asp]Date.parse()[/url]
×

Success!

Help @nectorsol spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...