def to_timestamp()

in core/timestamp.py [0:0]


def to_timestamp(seconds: float | int, with_ms: bool = False) -> str:
  """Returns a timestamp as a string to indicate the time of an event."""
  if with_ms:
    seconds = round(seconds * 1000) / 1000
  else:
    seconds = round(seconds)
  minutes = seconds // 60
  seconds = seconds % 60
  if with_ms:
    return f"{minutes:02.0f}:{seconds:06.3f}"
  else:
    return f"{minutes:02.0f}:{seconds:02.0f}"