Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
135
rated 0 times [  141] [ 6]  / answers: 1 / hits: 17282  / 11 Years ago, tue, july 30, 2013, 12:00:00

I get time in milliseconds from the server. I convert it to Date and get -
Mon Jul 22 2013 11:16:01 GMT+0200 (W. Europe Daylight Time) as the date in the record.



I want to separate out data of Monday, Tuesday etc into arrays. I am thinking of converting this date to Mon Jul 22 2013 23:59:59 GMT+0200 (W. Europe Daylight Time) and then filter out the records.



How can i change the date to the required end of the day time? or is there an easier way to do this ?


More From » javascript

 Answers
28

You could always construct a new DateTime object just using the year, month and day properties from the existing date, like so:



var actualDate = new Date(); // 2013-07-30 17:11:00
var endOfDayDate = new Date(actualDate.getFullYear()
,actualDate.getMonth()
,actualDate.getDate()
,23,59,59); // 2013-07-30 23:59:59

[#76644] Monday, July 29, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
emiliotristinv

Total Points: 181
Total Questions: 99
Total Answers: 96

Location: Argentina
Member since Fri, Oct 21, 2022
2 Years ago
;