I believe the date plugin is not time zone aware.
But since the unix epoch began at midnight UTC, to get the last midnight in UTC, you would simply omit the hours, minutes, seconds, and milliseconds parts of the timestamp. To do so, add date.get(year), date.get(month), and date.get(day) together. This will result in the timestamp leaving out the hours, minutes, seconds, and milliseconds since the last full day.
How to take into the account the local time zone I do not know.