There's definitely scientific evidence that one's perception of time can be influenced by actions which in no way something's duration.
It's not quite the happy/sad affect you're asking about, but it definitely suggests that one's perception of time can be meaningfully influenced by wholly unrelated information:
2010 Study: When doctors sit for patient consultations, they are perceived as staying longer, providing higher quality care
Patients consistently overestimated the time doctors spent with them much more when the doctors sat down while talking to them then when they remained standing. (The multiple was about 85% higher relative to the actual for the doctors who sat.)