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

126
Views
¿Es posible obtener un objeto de fecha de milisegundos en javascript?

Sé que un objeto de fecha de muestra en javascript se construye a partir de una cadena que contiene el año, el mes y el día. Estoy creando una función que toma una fecha y una cantidad de días como argumentos y agrega los días a la fecha y devuelve un nuevo objeto de fecha de la misma. El enfoque que utilicé es este:

a) Obtenga los milisegundos del objeto de fecha

b) Convertir los días a milisegundos

c) Sume los dos y luego derive un objeto de fecha de la suma resultante. Necesito una forma de volver a la fecha de los milisegundos. Gracias por su ayuda

 function AddDays(x,y){ //convert the days to milliseconds let days_milli=y*24*60*60*1000; //get the time in millis from the date let days_millis=x.getTime(); //add the times let total=days_milli+days_millis; //construct a date object from that //this line needs some help let date=getDate(total); return date; }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Parece que el constructor de la clase Date tiene sobrecargas para admitir la construcción de objetos a partir de una cadena y milisegundos. Todo lo que tenía que hacer era invocar una nueva fecha y luego poner los milisegundos en la parte del parámetro.

 function AddDays(x,y){ //convert the days to milliseconds let days_milli=y*24*60*60*1000; //get the time in millis from the datw let days_millis=x.getTime(); //add the times let total=days_milli+days_millis; //construct a date object from that let date=new Date(total); return date; }
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!