We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Yep, very crazy the way it uses day of week from 1 and months start at 0(like array).
I spent over an hour trying to figure this out, pulling my hair out. Was printing a few different things with System.err.println trying to figure out what was going on. I used a online date calculator that would give day of week, just to make sure their answer wasn't wrong. Anyway, I did run across something on StackOverflow about the situation. Actually, I believe I ran into this problem in the past. Been a few years since programmed in Java, that's why was here.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Date and Time
You are viewing a single comment's thread. Return to all comments →
Yep, very crazy the way it uses day of week from 1 and months start at 0(like array).
I spent over an hour trying to figure this out, pulling my hair out. Was printing a few different things with System.err.println trying to figure out what was going on. I used a online date calculator that would give day of week, just to make sure their answer wasn't wrong. Anyway, I did run across something on StackOverflow about the situation. Actually, I believe I ran into this problem in the past. Been a few years since programmed in Java, that's why was here.