A fetal pig's approximate age is determined by measuring its body length from the base of its tail to the tip of its snout, according to Massengale's Biology Junction. Unless the fetal pig is underdeveloped, this is a fairly accurate and easy way to determine how many weeks it developed prior to its death.
One easy way to determine the length of an object with an odd shape is to measure a piece of string cut to fit the object. In this case, the string is just long enough to stretch from the pig's tail to the tip of its nose. Although there are some exceptions to the rule, The Biology Corner explains that a fetal pig generally develops at a predictable rate, so its size reflects how long it developed in the womb.
For example, according to Wikipedia, a fetal pig that is 80 millimeters long has been developing for roughly 68 days. The length of the pig is compared to existing data collected by scientists who have evaluated other pigs at different stages of development. If the pig was underdeveloped or deformed, its siblings should be measured, if possible, to get a more accurate idea of its age.