// © Copyrights 2026 Praajna Pattada

#include <iostream>
#include <ctime>
#include <string>
#include <limits>

std::string_view GetMonth(int month)
{
    switch (month)
    {
        case 0: return "January";
        case 1: return "February";
        case 2: return "March";
        case 3: return "April";
        case 4: return "May";
        case 5: return "June";
        case 6: return "July";
        case 7: return "August";
        case 8: return "September";
        case 9: return "October";
        case 10: return "November";
        case 11: return "December";
        default: return "Invalid Month";
    }
}

std::string_view GetDay(int day)
{
    switch (day)
    {
        case 0: return "Sunday";
        case 1: return "Monday";
        case 2: return "Tuesday";
        case 3: return "Wednesday";
        case 4: return "Thursday";
        case 5: return "Friday";
        case 6: return "Saturday";
        default: return "Invalid Day";
    }
}

int main()
{
    struct tm* Time;
    time_t CurrentTime;
    time(&CurrentTime);
    Time = localtime(&CurrentTime);
    int Hour { Time->tm_hour };
    
    std::cout << "Today is " << Time->tm_mday << " " << GetMonth(Time->tm_mon) << " " << Time->tm_year + 1900 << " (" << GetDay(Time->tm_wday) << ")" << '\n';
    if (Hour > 12)
    {
        std::cout << "The time is " << (Hour - 12) << ":" << Time->tm_min << ":" << Time->tm_sec << " PM" << '\n';
    } else {
        std::cout << "The time is " << Time->tm_hour << ":" << Time->tm_min << ":" << Time->tm_sec << " AM" << '\n';
    }

    std::cin.clear();
    std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
    std::cin.get();
    return 0;
}
