You can simply use the following line:
var myTimestamp = firebase.firestore.Timestamp.fromDate(new Date());
.fromDate
is a static method from the static Timestamp class from Firebase.
Update:
For cloud functions look at JGuo's comment:
If you are writing cloud functions, it becomes
admin.firestore.Timestamp.fromDate()
– JGuo Jan 21 at 1:56