Sys.time does not return "formatted time". It returns the POSIXct class, which is the number of seconds since Unix. Of course, when you print this object, it returns a formatted time. But something is not printing what it is.
To get the current time in milliseconds, you just need to convert the output of Sys.time to numeric and multiply by 1000.
R> print(as.numeric(Sys.time())*1000, digits=15) [1] 1476538955719.77
Depending on the API call you want to create, you may need to remove fractional milliseconds.
source share