When you say in milliseconds, I guess you have some reference date in the past in mind (if not 0000-01-01)? and that effectively makes it some kind of dataTimeDuration. Then you can use days/hours/minutes/seconds-from-duration() to get those components. Some nominal arithmetic on them would give you the milliseconds.
Also with version 2.0, you can take profit of the built-in current-dateTime() rather than using exslt function library.