0

How will I convert epoch timestamp millisecond to current time stamp milliseconds.

My Try:

 var time = (resp.timestamp * 1000) + 1980000000;

resp.timestamp -> epoch timestamp

I have tried adding 5hrs 30 minutes(converted to miliseconds) to the epoch timestamp but I am unable to get current time.

Nagendra Singh
  • 61
  • 1
  • 11

1 Answers1

0

UPDATED try this:

 function ToLocalDate () {

        var n = Date.now()
        var d = new Date(n);
        console.log(d);
        console.log(d.getDate());
        console.log(d.getMonth());
        console.log(d.getFullYear());
        console.log(d.getHours());
        console.log(d.getMinutes());
        console.log(d.getSeconds());
       }
    ToLocalDate ();
Suchit kumar
  • 11,809
  • 3
  • 22
  • 44