timestamp convert moment vue
<template>
<div>
<p>{{ formattedTimestamp }}</p>
</div>
</template>
<script>
import moment from 'moment';
export default {
data() {
return {
timestamp: 1638748800000, // Replace with your timestamp
};
},
computed: {
formattedTimestamp() {
return moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss');
},
},
};
</script>
<style>
/ Your component styles go here /
</style>