Obstructive sleep apnea (OSA) is a novel risk factor for coronary heart disease and screening polysomnography is recommended. Yet, optimal time to perform polysomnography is unknown. We sought to determine if the diagnosis of OSA is influenced by the timing of polysomnography and its interaction with different presentations of coronary heart disease.We prospectively recruited 160 patients admitted with acute myocardial infarction (AMI) or stable coronary artery disease (CAD) for either in-hospital (n=80) or post-discharge (n=80) polysomnography.The median time from admission to polysomnography for in-hospital and post-discharge groups was 1day and 17days, respectively (p<0.001). Overall, 59 patients (36.9%) were diagnosed with OSA (apnea-hypopnea index [AHI] ⩾15). In patients presenting with AMI (n=80), the average AHI was higher in the in-hospital than post-discharge group (55.0 vs. 27.5, p=0.022). In patients presenting with stable CAD (n=80), no significant differences were observed (27.5 vs. 37.5, p=0.474). OSA patients were more likely to have the polysomnography done during the in- hospital than post-discharge period (55.9% vs. 46.5%, p=0.037). Logistic regression analysis revealed a significant interaction between clinical presentation and effect of polysomnography timing on diagnosis of OSA (p=0.003). The timing of polysomnography predicted the risk of OSA in patients presenting with AMI (adjusted OR 3.84%, 95% CI 1.42–10.41, p=0.008), but not those presenting with stable CAD. Other independent predictors included body mass index, diabetes mellitus and hyperlipidemia.The timing of polysomnography influences the diagnosis of OSA in patients presenting with AMI, but not in those presenting with stable CAD. There is a higher chance of diagnosing OSA in AMI patients when polysomnography is done in-hospital compared to post-discharge. The role of AMI-induced myocardial is stunning in the diagnosis of OSA and deserves further study.