There are a number of ways to achieve this.
If currentTimestamp is a string, just get the date parts (year, month, day) and compare. You haven't shown the format so how you do that is up to you.
If currentTimestamp is a date, you can use nnnnnn's suggestion and compare the date strings:
if (currentTimestamp.toDateString() == previousTimestamp.toDateString())
However since the value of toDateString is implementation dependent, should only be used within the host, strings should not be compared across hosts.
If you don't mind modifying the Date value, then:
if (currentTimestamp.setHours(0,0,0,0) == previousTimestamp.setHours(0,0,0,0))
will also return true if both are on the same day. If you don't want to change the dates, copy them first:
if (new Date(+currentTimestamp).setHours(0,0,0,0) == new Date(+previousTimestamp).setHours(0,0,0,0))
Whatever suits.
And as Matt notes, your concept of "day" should be clarified to local day or UTC day (or any other time zone) since times near the start and end of a local day are likely on different UTC (or other time zone) days, and vice versa.