Utilizing a timestamp attribute, I have successfully implemented the display of the current time and date on my webpage.
Is there a way to showcase this information in a specific time zone? I am looking to present it in the ZULU timezone, which remains static and does not adhere to 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>