145
rated 0 times
[
152]
[
7]
/ answers: 1 / hits: 22003
/ 13 Years ago, wed, august 3, 2011, 12:00:00
I'd like to determine if a given date object is the same day as the current day. Below is the psuedo code.
// date is a Date object
function (date)
{
if (date == Today())
alert('How are you today?');
else
alert('How were you last ' + date.toDateString() + '?');
}
How do I implement the Today() function? It doesn't have to be a function really, an equivalent solution will be just as good. Thanks.
[edit]
I forgot to mention. The current time (today) is local time and the date object that it will be compared with is server time, which can be anywhere in the world.
More From » jquery