// Name: Time Stamp Convert // Description: Converts timestamp to human-readable date // Author: JosXa import { DateTime } from 'luxon'; try { // Prompt the user to enter a timestamp const timestamp = await arg("Enter timestamp (e.g., 1740152737663):"); // Attempt to convert the timestamp to a number and create a DateTime object const dateTime = DateTime.fromMillis(Number(timestamp)); // Check if the DateTime object is valid if (dateTime.isValid) { // If valid, display the formatted date and time await div(dateTime.toLocaleString(DateTime.DATETIME_FULL)); } else { // If invalid, display an error message await div("Invalid timestamp"); } } catch (error) { // Handle any potential errors during the process console.error("An error occurred:", error); await div(`An error occurred: ${error}`); }