Disclosed are compounds of formula (I) (esters of an alkanediol and a polyunsaturated fatty acid), wherein n is an integer between 1 and 15, m is 0, 1, 2, or 3, and R is the hydrocarbon chain of a polyunsaturated fatty acid selected from omega-3 and omega-6. Further disclosed is a pharmaceutical or cosmetic composition comprising a compound of formula (I), the use of a compound of formula (I) in the preparation of a pharmaceutical or cosmetic composition for the treatment of acne or seborrheic dermatitis, and a method for preparing a compound of formula (I) by coupling a polyunsaturated fatty acid selected from omega-3 and omega-6 fatty acids, whose carboxylic acid function is in free or activated form, and a diol.