The data property is design for storing variables, not invoking functions or adding logic like you're trying to do.

Try computed property:

computed: {
  tomorrow() {
    const d = new Date()
    d.setDate(d.getDate() + 1)
    return d 
  }
}

And then in your template you can do {{ tomorrow }} or in your vue component this.tomorrow

Answer from Bergur on Stack Overflow
🌐
Vue.js Developers
vuejsdevelopers.com › lessons › adding-days-to-day-select-1 › 1
Adding days to day-select
Looking at the finished product, we can see that the day select displays an inline list of days, starting from today, and finishing the date a week from now. Let's now add a script tag to the component and import the dayjs library to help us working with dates.
🌐
CodePen
codepen.io › blokche › pen › YQddLq
vue.js - Date manipulation
<div id="app" v-cloak> <div :class="['time', {changed:isAltered}]"> {{ date | date('DD/MM/YYYY') }}<br /> {{ date | date('HH:mm:ss') }} </div> <div class='controls'> <div> <label for="days">Add Days</label> <input type="number" name="days" id="days" v-model.number='addDays'> </div> <div> <label for="months">Add Months</label> <input type="number" name="months" id="months" v-model.number='addMonths'> </div> <div> <label for="hours">Add Hours</label> <input type="number" name="hours" id="hours" v-model.number='addHours'> </div> <div> <label for="minutes">Add Minutes</label> <input type="number"
🌐
date-fns
date-fns.org
date-fns - modern JavaScript date utility library
date-fns provides the most comprehensive yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.
🌐
YouTube
youtube.com › edward lance lorilla
Add Days to Date vuejs - YouTube
AboutPressCopyrightContact usCreatorsAdvertiseDevelopersTermsPrivacyPolicy & SafetyHow YouTube worksTest new featuresNFL Sunday Ticket · © 2024 Google LLC
Published   July 19, 2018
Views   984
🌐
The Valley of Code
thevalleyofcode.com › how-to-add-days-date-javascript
How to add days to a date in JavaScript
Today I have the solution to this problem: you have a Date object in JavaScript, and you want to add some days to it.
🌐
Daypilot
code.daypilot.org › 46517 › vue-js-scheduler-changing-visible-date
Vue.js Scheduler: Changing Visible Date | DayPilot Code
To switch to the next month, we simply add one month to the current startDate value. <template> <div class="buttons"> <button id="next" @click="next">Next</button> </div> <DayPilotScheduler ref="schedulerRef" scale="Day" :days="days" :startDate="startDate" ... /> </template> <script setup> import { DayPilot, DayPilotScheduler } from '@daypilot/daypilot-lite-vue' import { ref, computed } from 'vue' const schedulerRef = ref(null) const startDate = ref(DayPilot.Date.today().firstDayOfMonth()) const days = computed(() => startDate.value.daysInMonth()) const next = () => { startDate.value = startDate.value.addMonths(1) } </script>
Find elsewhere
🌐
CoreUI
coreui.io › answers › how-to-add-days-to-date-in-javascript
How to add days to date in JavaScript · CoreUI
September 30, 2025 - The most reliable approach is using ... eliminates edge case bugs that plague manual date arithmetic. Use setDate() with getDate() to safely add days to any date....
🌐
Mobiscroll
demo.mobiscroll.com › vue › range › date-range
Vue Range Date range Example | Mobiscroll
Javascript jQuery Angular React ... on GitHub · View SFC JS code on GitHub View SFC TS code on GitHub · Use the range picker for a new event creation....
🌐
Debbie Codes
debbie.codes › blog › date-formatting
Formatting a date in JavaScript · Debbie Codes
We can then use our method like we would use any Vue method in our template passing in the date want formatted · <template> <p> {{ formatDate('2020-12-25') }} </p> </template> ... We can also use different options. Perhaps we want to show the day of the week. We can do this by adding in the weekday.
🌐
Vue3datepicker
vue3datepicker.com
Vue Datepicker
Vue 3 datepicker component. Lightweight and powerful with support for the timepicker, range picker, month-year picker, text input, week numbers and many more. Options to customize the datepicker from the ground up with props, slots and custom components. Dark and light mode available
🌐
Vuetify
vuetifyjs.com › en › features › dates
Dates — Vuetify
Vuetify has first party date support that can easily be swapped for another date library
🌐
Stack Overflow
stackoverflow.com › questions › 36586535 › vue-js-date-off-by-one
Vue.js date off by one
method:{ getDateClean(currDate: Date) { // need to convert to UTC to get working input filter console.log(currDate); let month: number | string = currDate.getUTCMonth() + 1; if (month < 10) month = "0" + month; let day: number | string = currDate.getUTCDate(); if (day < 10) day = "0" + day; const dateStr = currDate.getUTCFullYear() + "-" + month + "-" + day + "T00:00:00"; console.log(dateStr); const d = new Date(dateStr); console.log(d); return d; } } See running example from answer in https://stackoverflow.com/a/63838211/2875452; ... A flight simulator for developers to practice real world challenges and... Goodbye Webpack, hello Turbopack! The big news from today’s Next.JS conference
Top answer
1 of 4
38

Because the time at present isn't depend on any data variable, so we can write it in methods, and call in created

Read more about computed and methods here

You can copy and run it in CodingGround

<html>
   <head>
      <title>VueJs Introduction</title>
      <script type = "text/javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.3/vue.min.js">
      </script>
   </head>
   <body>
      <div id = "intro" style = "text-align:center;">
         <h1>{{ timestamp }}</h1>
      </div>
      <script type = "text/javascript">
         var vue_det = new Vue({
            el: '#intro',
            data: {
               timestamp: ""
            },
            created() {
                setInterval(this.getNow, 1000);
            },
            methods: {
                getNow: function() {
                    const today = new Date();
                    const date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
                    const time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
                    const dateTime = date +' '+ time;
                    this.timestamp = dateTime;
                }
            }
         });
      </script>
   </body>
</html>
2 of 4
1

Assuming you have a component, like Dashboard.vue, you can use a getter:

<template>
  <v-container fluid>
    <h1>{{ timestamp }}</h1>
  </v-container>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';

@Component
export default class Dashboard extends Vue {
  get timestamp() {
    const today = new Date();
    const date = today.getFullYear() + '-' + (today.getMonth()+1) + '-' + today.getDate();
    const time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
    const timestamp = date + ' ' + time;
    return timestamp;
  }
}
</script>
🌐
W3docs
w3docs.com › javascript
How to Add Days to JavaScript Date
Read the tutorial and learn a simple method of adding days to JavaScript date with two inbuilt functions used for setting and getting the day of the month.
🌐
Code with Hugo
codewithhugo.com › add-date-days-js
Add days to a Date in vanilla JavaScript · Code with Hugo
May 1, 2020 - Despite the JavaScript Date warts, it’s straightforward to add day(s) to a date in JavaScript. While it would be very easy to reach for moment.js or another date manipulation library (date-fns, luxon, dayjs) to do something as simple as adding days to a Date in JavaScript, writing a short helper function might just be easier.
🌐
Telerik
telerik.com › components › date math › date calculations
Vue Date Math Date Calculations - Kendo UI for Vue
To add or remove a conditional number of days from a Date object, use the addDays method.