Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
how to parse date and time from timestamp in nuxt3

I want to parse date and time from the following time stamp in my Nuxt3 project using Date Fns. on Date select on calender, this is the value we get.

const SelectedDate = "Sat Jul 02 2022 14:56:04 GMT+0530 (India Standard Time)"

I want to extract date and time from this, like.

Const Date = "02/07/2022"
Const Time = "14:56"

but i get wrong time, as result i get -

const Time = "14:07"

I have used this.

<script setup>
import { ref, reactive } from "vue";
import { format, compareAsc } from 'date-fns'
let pickdate = ref(new Date());

const FormattedDate = ref(format(pickdate.value, 'dd/MM/yyyy'))
const FormattedTime = ref(format(pickdate.value, 'HH:MM'))
</script>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!