The TimeSpan Converter is an OutSystems Forge component designed to convert any given DateTime value into a human-readable relative time format. It works for both past and future dates, making it easy to display messages like:
Past examples "Just now", "5 minutes ago", "2 hours ago", "Yesterday", "3 months ago"
Future examples "in 5 minutes", "in 2 hours", "Tomorrow", "in 3 days", "in 2 years"
This component is useful for applications that display timestamps, event schedules, notifications, logs, and chat messages.
Case 1: Past Timestamp
Input: 2025-08-31 08:00:00
2025-08-31 08:00:00
Current Time: 2025-08-31 09:30:00
2025-08-31 09:30:00
Output: 1 hour ago
1 hour ago
Case 2: Future Timestamp
Input: 2025-09-02 14:00:00
2025-09-02 14:00:00
Current Time: 2025-08-31 10:00:00
2025-08-31 10:00:00
Output: in 2 days
in 2 days