These girls are having a great time looking for seashells.
The girls are happy.
the girls are having great time looking for seashells so they are happy.
When someone is having a great time they're happy.
Having a great time generally implies that your are in a happy mood.