I've read somewhere that in the 18th century, sailors would have to eat hardtacks filled with weevils. Was this the case for ww2 sailors too? What did daily diet usually consist of assuming the ship wasn't damaged or incapacitated?
I wrote a bit about this here, concerning the RN. The food was certainly much better than it was in the 18th and 19th centuries, though aboard older or smaller ships, this would depend on how good your messmates were at cooking. Also worth reading is this answer on food storage aboard ship.
Your average fighting soldier probably needs around 3,700 calories a day to be in fighting condition. All the nations in the war knew this, but not all of them were equipped to provide that.
US: The US military had a standard sets of rations for all branches of military, the A, B, C, K, and D rations. Afterall, a man needs the same calories/vitamins when they are at sea as they do on land. The A rations were the "garrison" rations, fresh, refridgerated, or frozen ingredients, one designed to be prepared in kitchens for personel away from the fight. B rations were designed for field kitchens, so were similar to the A rations but filled with heavily preserved foods instead of the fresh/frozen stuff. Both the A and B rations provided 4,000 calories a day. C rations were for combat situations, with preperpared meals that could just be openned and eaten. This usually provided about 3,700 calories a day. K rations were a bit more specialized "assualt" rations for paratroopers and other specialized mobile/away from supply line troops. These only had 2,700 calories per ration and were only meant to be used for no more than 15 days. Finally, the dreaded D ration were for emergencies. Truly unappitizing stuff, including a chocolate bar that was designed to taste aweful to prevent soldiers from casually munching on them when the situation wasn't dire. Most of these rations came in Breakfest, Lunch, and Dinner varieties.
The one specialy designed naval ration was the Lifeboat ration, hard candy and vitamin tablets in a waterproof case that were kept in the lifeboats. This ration was designed to keep the occupants of a lifeboat alive long enough for rescue.
Incidently, most of these rations (barring the emergency ones) actually came with cigerettes.
Since Naval crews were usually on ships, they were usually treated to A or B rations, as the ships contained at least a basic kitchen to cook the food. That doesn't mean it was particularly apetizing. Spam, powdered milk, tasteless biscuits, WW2 rations were designed to 1. provide as many nuitrients/calofries per ounce 2. in the most space effecient form as possible 3. would last in storage as long as possible and 4. at the lowest price. Taste was usually the last priority (and as stated with the D ration, was sometimes intentionally made worse). Still, US soldiers usually enjoyed around 4,000 calories a day and got all their vitamins.
Japan: While the American soldiers endlessly complained about their terribly tasting food, the Japanese were cronically underfed and lacked vital vitamins. Most of the Japanese rations were made up of rice in various forms. The "garrison" ration provided only 3,000 calories on good days mostly a rice/barely mixture (the barely was there to provent beriberi) and suplemented with a large amount of vegitables, and a small amount of meat/fish. Yes, this is only 300 more calories than what the US provided to their paratroopers. The combat ration (the "Assaku Koryo") was mostly dried rice plus soybean paste, soy sauce, and salt. Sometimes this was supplemented by canned vegitables/tuna.
Of course, again, this was the "ideal" situations. As Japan was running low on all resources throughout the war, and supply lines to the Pacific islands/fleets were stretch so damn thin, this ideal rarely meshed with reality. Sometimes Japanese troops were only given uncooked rice that they had to cook themselves (particularly risky as setting a fire could give away your position). Thousands of Japanese soldiers died of starvation.
Edit: Sources: Japanese Food Management in World War II by Bruce F. Johnston
Here is an article discussing the rations of the fighting nations in the Pacific theater
Here is a US WW2 training/proganda film on military rations,. Be aware that they are clearly upselling the tastiness of US rations while dissing the rations of the enemies.
So just to highlight how both cookie cutter from bulk bought ration items, and creative some ships could get we can look at some actual menu's. Even smaller vessels could have access to meals that if not 5* were at least varied, and far from gruel.
Especially when it came to holiday's that the commissary could pull out all the stops.
Here for instance is the battleship North Carolina's menu for Thanksgiving dinner in 1943. Menu.
And the much smaller escort carrier Bogue's Christmas fest in 1944. Notice that the ham and dinner sides are the same! Even a holiday feast is easy to mass produce when you need to.
However this wasn't really new either, if not amazing prewar fare was far from the worst too, here is the battleship Idaho's Thanksgiving menu from 1936. Good Lord the Navy sure does love its Asapargus.
Now this does represent about as good as the food would get being from the big battlewagon's and a carrier, but these also represented a major portion of the manpower of the Navy, each with 100's to 1000's of crew each.
Hi, there's more on WWII Japanese Navy rations here