Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Date to number JS function not working as expected

edited May 11, 2019 12:25PM in Integration 12 comments

Summary

I am using below JS function for convert date to number

Content

I am using below  JS function for convert date to number  

In Browser it working and give a result as 11572923446000

But OIC provides NaN as a result.

 

Is any parser problem in Code?

Any default function is there convert date to number!

 

function dateToNumber(datetoNum){

  var NumberDate = Date.parse(datetoNum);

   return NumberDate; 
}

var dateVar = dateToNumber('11-05-2019 03:10:46 UTC')

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!