// Copyright 2025 Jeisson Hidalgo-Cespedes CC-BY-4 #include #include "format_time.h" #define CAPACITY 48 void print_time(const time_t seconds); int main(int argc, char* argv[]) { // If command line arguments were provided if (argc >= 2) { // Convert each given argument to formatted time for (int index = 1; index < argc; ++index) { print_time(atol(argv[index])); } } else { // Convert current time print_time(time(NULL)); } } void print_time(const time_t seconds) { char buffer[CAPACITY] = { '\0' }; printf("%ld\t%s\n", seconds, format_time(seconds, buffer, CAPACITY)); }