Women are advised to be vaccinated for influenza during pregnancy and may receive vaccine at any time during their pregnancy. In observational studies evaluating vaccine safety in pregnancy, to account for such time-varying vaccine exposure, a time-dependent predictor can be used in a proportional hazards model setting for outcomes such as spontaneous abortion or preterm delivery. Also, due to the observational nature of pregnancy exposure cohort studies and relatively low event rates, propensity score (PS) methods are often used to adjust for potential confounders. Using Monte Carlo simulation experiments, we compare two different ways to model the PS for vaccine exposure: (1) logistic regression treating the exposure status as binary yes or no; (2) Cox regression treating time to exposure as time-to-event. Coverage probability of the nominal 95% confidence interval for the exposure effect is used as the main measure of performance. The performance of the logistic regression PS depends largely on how the exposure data is generated. In contrast, the Cox regression PS consistently performs well across the different data generating mechanisms that we have considered. In addition, the Cox regression PS allows adjusting for potential time-varying confounders such as season of the year or exposure to additional vaccines. The application of the Cox regression PS is illustrated using data from a recent study of the safety of pandemic H1N1 influenza vaccine during pregnancy.