<template>
  <div class="msg-time">{{showTime}}</div>
</template>

<script>
import dayjs from 'dayjs'

export default {
  name: 'msgTime',
  props: {
    timestamp: {
      type: [String, Number],
      required: true
    }
  },
  computed: {
    showTime () {
      return dayjs(this.timestamp * 1).format('HH:mm')
    }
  }
}
</script>

<style lang="scss" scoped>
.msg-time{
  text-align: center;
  margin: 0 auto 10px;
  max-width: 50%;
  font-size: 12px;
  padding: 1px 18px;
  color: #b2b2b2;
}
</style>
