let date = new Date(1647695970000);
console.log(date.toDateString())
//use .getTime()
const timestamp = new Date().getTime();
from datetime import datetime
# current date and time
now = datetime.now()
timestamp = datetime.timestamp(now)
print("timestamp =", timestamp)
int ts = 1638592424384;
DateTime tsdate = DateTime.fromMillisecondsSinceEpoch(timestamp);
String fdatetime = DateFormat('dd-MMM-yyy').format(tsdate); //DateFormat() is from intl package
print(fdatetime); //output: 04-Dec-2021
1. vrien de lijk