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

189
Views
how to convert string 7thJun1969 to date 1969-06-07 in javascript shine.com simple method

here is code explanation convert string 7thJun1969 to date 1969-06-07 in JavaScript Here I use the slice method to solve the problem shine.com question

<script>
// function to change the formate of date
function changeDateFormate(givenDate){
    let year = givenDate.slice(-4);
    let month = givenDate.slice(-7).slice(0,-4);
    let day = givenDate.slice(0,-9);
    let obj = {
        Jan : "01",
        Feb : "02",
        Mar : "03",
        Apr : "04",
        May : "05",
        Jun : "06",
        Jul : "07",
        Aug : "08",
        Sep : "09",
        Oct : "10",
        Nov : "11",
        Dec : "12"
    }
    if(day < 10){
        day = 0+""+day;
    }
    let finalDate = year + "-" + obj[month] + "-" +day;
    return finalDate;
}

// code output 
console.log("1stOct1948");
</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!