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

179
Views
Given a start time of a slot in 12hrs time format (say "2: 45 PM") and a period in mins after this ends 15 for eg. How would you calculate end time?

I have a date slot in string (12hrs) format eg - "2:45 PM" and a time period to when this slot ends say 15 (mins). So time slots starts at "2: 45 PM" and ends in 15 mins. I want to show the ending time in the same format as time string in 12hrs format.

Example - Slot: "2: 45 PM", ends: 15 endingSlot will be "3: 00 PM"

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I'd use a library for that — e.g. Moment.js:

import * as moment from 'moment';

const slot = '2.45 PM';
const endingSlot = moment(slot, 'h:mm A').add(15, 'minutes').format('h:mm A');

console.log(endingSlot); // 3:00 PM
about 4 years ago · Juan Pablo Isaza Report
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!