In online social networks, trust relationships between users play a vital role in connecting like-minded friends and identifying trustworthy information. However, conventional approaches, mainly utilizing graph attention networks, often regard trust interactions as static and neglect their dynamic nature. Such a limitation undermines the precision of modeling trust dynamics and obstructs the comprehension of how trust evolves within online social networks. To address this challenge, we propose TrustFormer, a novel collaborative approach that integrates time-dependent trust interactions and explicitly predicts dynamic trust relationships. Specifically, TrustFormer first embeds an evolving topology from trust interactions to capture latent temporal features. It then applies time encoding within a multi-head attention network, quantifying the significance of time-sensitive topological features. Further, TrustFormer employs bidirectional interaction transferring to formalize shared trust topological features. Finally, pairwise trust relationships are evaluated using these topological features. Supported by extensive experiments on two real-world datasets, our approach demonstrates significant improvements in trust dynamics modeling, outperforming state-of-the-art methods in accuracy.