Skip to main content

timestamp.go

timestamp.go - Overview

  1. Overview This file provides utility functions for converting between time.Time objects and millisecond timestamps (int64).

  2. Detailed Documentation

FromTime

  • Purpose: Converts a time.Time object to a millisecond timestamp (int64).
  • Parameters:
    • t (time.Time): The time object to convert.
  • Returns:
    • int64: The millisecond timestamp representing the time.

Time

  • Purpose: Converts a millisecond timestamp (int64) to a time.Time object.
  • Parameters:
    • ts (int64): The millisecond timestamp to convert.
  • Returns:
    • time.Time: The time.Time object representing the timestamp.

Include in Getting Started: NO