Working with date and time the build in Date object of javascript may not be enough for you. The Moment.js package will most likely offer you what you need. Here are some examples (many borrowed from the Moment.js Documentation website). Below you can see code examples. Their outcome may be stored and reused as variables . Example: today .