Sort by

recency

|

1544 Discussions

|

  • + 0 comments

    That would be really helpful if you help me integrate this code in my Paving service website.

  • + 0 comments

    My Java solution:

    public static String dayOfProgrammer(int year) {
        StringBuffer buf = new StringBuffer();
        int day = 13;
    
        if (year == 1918) {
            day = 26;
        } else if (year < 1918) {
            if (isJulianLeapYear(year)) day-=1;
        } else if (year > 1918) {
            if (isGregorianLeapYear(year)) day-=1;
        }
    
        buf.append(day + ".09." + year);
    
        return buf.toString();
    }
    
    private static boolean isJulianLeapYear(int year) {
        if (year % 4 == 0) return true;
        return false;
    }
    
    private static boolean isGregorianLeapYear(int year) {
        if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)) return true;
        return false;
    }
    
  • + 1 comment

    How come the answer for year = 1918 is 26.09.1918 ?

    Most solutions seem to have hardcoded this value

  • + 1 comment

    For most years, the Day of the Programmer falls on 13.09.yyyy, but if it’s a leap year, it’s 12.09.yyyy. For the year 1918, due to the calendar change in Russia, the date is 26.09.1918. Cloud-Anbindung Azure

  • + 0 comments

    Happy Day of the Programmer! To all the brilliant minds behind the code, your creativity fuels innovation. Whether you are debugging or deploying, your impact is huge. And if you are thinking of upgrading your Mac for better performance, check out Dubai’s Trusted Mac Experts for smooth and reliable device resale!