Rotating machinery fault diagnosis is very important for industrial production. Many intelligent fault diagnosis technologies are successfully applied and achieved good results. Due to the fact that machine damages usually happen under different working conditions, and manual scale labeled data are too expensive, domain adaptation has been developed for fault diagnosis. However, the current methods mostly focus on global domain adaptation, the application of subdomain adaptation for fault diagnosis is still limited. A deep transfer learning method is proposed for rotating machinery fault diagnosis in this study, where subdomain adaptation and adversarial learning are introduced to align local feature distribution and global feature distribution separately. Experiments are performed on two rotating machinery datasets to verify the effectiveness of this method. The results reveal that this method has outstanding mutual migration ability and can improve the diagnostic performance.