1

Can't believe I'm unable to find the very simple case of converting a Javascript date object to Filetime.
The other way around popped up a lot while searching.

I have provided the solution below for anyone else who is looking for it.

GusOst
  • 4,105
  • 3
  • 19
  • 28

1 Answers1

3

To convert now to Filetime:

function filetimeFromDate(date) {  
    return date.getTime() * 1e4 + 116444736e9;
}
const now = new Date();
const filetimeNow = filetimeFromDate(now);
console.log(filetimeNow);
GusOst
  • 4,105
  • 3
  • 19
  • 28