As the story went, a poor woodcutter got lost when cutting down firewood in the mountains.He saw two people in a cave, so he enter the cave hoping to ask direction. He noticed the two elderly sages were playing Chinese chess, being the polite guy that he was, the woodcutter stood on the side and quietly waited for the two sages to finish. He was mesmerized by the chess game and forget about the time. After they're done, the sages had invited the woodcutter to share food with them before sending him home. The woodcutter stepped out of the cave only to discover the world had moved on without him. While he might have spend only one day in this cave, a thousand years had passed outside the cave.
Hence the saying " 洞中方一日，世上已千年" (One day in the cave, thousands years had passed in the world).
There has been a recurring stories about time passed by without the protagonist knowing. Some variations talked about the woodcutter saw delicious dates, he ate some and fall asleep, woke up later only to find years had passed by and the wood handle of his axe was decomposed.
Other variations went more elaborate saying how a guy was invited by beautiful fairies (or demons) into a banquet (or living with them) for a few days. After he left the fairy house, he found out the time has passed by, all his families even his children were long dead. He went back to search for the fairy house but could never find it again.
I think there're western folklores talking about the same thing, how someone entered a different world where the time passes differently. It's interesting to see how eastern and western myth end up telling the same type of stories.