Datalayer VS Code Extension - v0.0.6
    Preparing search index...

    Function formatRelativeTime

    • Formats a date as a relative time string (e.g., "2 hours ago", "3 days ago"). Provides human-readable relative time descriptions.

      Parameters

      • date: Date

        The date to format relative to now

      Returns string

      Formatted string like "just now", "5 minutes ago", "2 days ago"

      const timeAgo = formatRelativeTime(new Date(Date.now() - 3600000));
      // Returns: "1 hour ago"