Sidebar

What is today? Can I check to see if a date is today?

0 votes
9.6K views
asked May 11, 2018 by rich-c-2789 (17,490 points)
retagged May 11, 2018 by rich-c-2789
I need to check a date in incoming messages.  Is there a quick function for checking if the date is today?

1 Answer

0 votes

Yes.  In the code wizard there is a new function:  qie.isToday(date).  Below are the details from the code wizard:

Below is a quick example that assumes today is '04/30/2018':

qie.debug('Q: Is given date today?');

qie.debug("A: for '04/29/2018': " + qie.isToday('04/29/2018'));
qie.debug("A: for '04/30/2018': " + qie.isToday('04/30/2018'));
qie.debug("A: for '05/01/2018': " + qie.isToday('05/01/2018'));

Output:

Q: Is given date today?

A: for '04/29/2018': false
A: for '04/30/2018': true
A: for '05/01/2018': false

 

See also:

What day is it? How to use code wizard functions to compare dates in javascript?

answered May 11, 2018 by rich-c-2789 (17,490 points)
edited May 11, 2018 by rich-c-2789
...