timestamp static method

String timestamp(
  1. DateTime value, {
  2. TimestampStyle? style,
})

Returns a timestamp text

final str = Md.timestamp(DateTime.now());

Implementation

static String timestamp (DateTime value, { TimestampStyle? style }) => style != null
  ? '<t:${(value.millisecondsSinceEpoch / 1000).round()}:${style.value}>'
  : '<t:${(value.millisecondsSinceEpoch / 1000).round()}>';