Timestamp.fromDate constructor
- DateTime date
Creates a Timestamp from a DateTime.
Parameters:
date: The DateTime object.
Returns: A Timestamp instance.
Example:
var ts = Timestamp.fromDate(DateTime(2021, 1, 1));
Implementation
factory Timestamp.fromDate(DateTime date) {
return Timestamp.fromMicrosecondsSinceEpoch(date.microsecondsSinceEpoch);
}