I am using a timestamp attribute to display the current time and date on my page.
Is it possible to display it in a particular time zone? I want to display it in ZULU timezone which is static and does not observe daylight saving time.
<script>
import Logger from './Logger'
export default {
name: 'Navbar',
components: {
Logger
},
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() + " - " + "ZULU";
const dateTime = date +' '+ time;
this.timestamp = dateTime;
}
}
}
</script>