I am trying to send a millisecond timestamp to a web service using UrlFetch in a google app script. My web service expects the time in the format 1433563200021, but google app script keeps converting it to a string with an exponent: 1.433563200021E12, even if I call Number(startDate.getTime()). How do I get google app script to store just the numeric value in a variable?
I found out that you can call the toFixed(0) method to force it to remove the exponential format. E.g.
var start = new Date();
var startTime = Number(start.getTime()).toFixed(0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With