Well he could figure it out based on when he bought it and when the exp date was and calculating how long it had to expire vs how long hes been in that world. Its not like the time it takes to expire changes cause he went back in time with the ingredients
HOW DOES HE EVEN KNOW THAT IT'S ABOUT TO EXPIRE! LIKE WHAT?? DUDE YOU TIME TRAVELLED AND SHIT