Skip to content

Instantly share code, notes, and snippets.

@basarat
Last active February 21, 2022 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save basarat/ecf35de130c383707edc68c52f5187b2 to your computer and use it in GitHub Desktop.
Save basarat/ecf35de130c383707edc68c52f5187b2 to your computer and use it in GitHub Desktop.
import { add } from 'date-fns';
/** Add one day to a given input */
function tomorrow(date: Date) {
return add(date, { days: 1 });
}
const now = new Date('2022-04-03 00:00:00');
const next = tomorrow(now);
console.log(now.toLocaleString(), '--', next.toLocaleString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment