You are viewing a single comment's thread. Return to all comments →
CAN YOU PLEASE EXPLAIN THE BELOW CODE: char plus12 = n_hour >= 12; n_hour += time[8] == 'P' ? (plus12 ? 0 : 12) : (plus12 ? -12 : 0); printf("%02d:%.*s:%.*s", n_hour, 2, time + 3, 2, time + 6);
Seems like cookies are disabled on this browser, please enable them to open this website
Time Conversion
You are viewing a single comment's thread. Return to all comments →
CAN YOU PLEASE EXPLAIN THE BELOW CODE: char plus12 = n_hour >= 12; n_hour += time[8] == 'P' ? (plus12 ? 0 : 12) : (plus12 ? -12 : 0); printf("%02d:%.*s:%.*s", n_hour, 2, time + 3, 2, time + 6);