The association between heatwave exposure and the risk of incident diabetes in middle-aged and older adults: a cohort study based on CHARLS Authors: Wenfei Yang, Yan Lin, Caihua Ye, Xiang Zhang, Xinjun Jiang Published: 2025 ABSTRACT AbstractBackgroundThis study investigated the association between heatwave exposure and the risk of new-onset diabetes among middle-aged and older adults, and further assessed the modifying effects of air pollution and green space.MethodsData were obtained from two follow-up waves of the China Health and Retirement Longitudinal Study (CHARLS) conducted in 2015 and 2018, involving 6,591 adults aged ≥ 45 years who were free of diabetes at baseline. Twelve city-specific heatwave definitions were constructed based on the 90th–97.5th percentiles of daily maximum temperatures combined with durations of ≥ 2, ≥3, or ≥ 4 consecutive days. Generalized additive models and generalized difference-in-differences (G-DiD) analyses were employed to assess the associations between changes in heatwave exposure (days/events) and new-onset diabetes risk. Potential modifying effects of fine particulate matter (PM2.5) and Normalized Difference Vegetation Index (NDVI) were also examined.ResultsUsing heatwave definitions HW2 (≥ 90th percentile for 3 days) and HW12 (≥ 97.5th percentile for 4 days), significant associations between heatwave exposure and increased diabetes incidence were observed (OR = 1.160, 95% CI: 1.008–1.334 and OR = 1.224, 95% CI: 1.012–1.480, respectively). Stratified analyses showed that the association weakened in areas with greater reductions in PM2.5. Additionally, areas with higher NDVI demonstrated a protective modifying effect. Subgroup analyses further indicated a higher diabetes risk among males, individuals aged ≥ 60 years, and those with baseline chronic diseases.ConclusionHeatwave exposure of specific intensity and duration increases the risk of new-onset diabetes, whereas improved air quality and higher vegetation coverage have protective effects. Males, individuals aged 60 years and older, and those with existing chronic diseases are more susceptible. Given ongoing climate change, public health strategies should incorporate high-temperature warnings, air quality management, and urban greening to protect high-risk populations.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12889-025-26017-5.Keywords: Heatwave exposure, Diabetes, Air pollution, Green space, CHARLS Introduction According to data from the 11th edition of the IDF Diabetes Atlas (2025), approximately 589 million adults worldwide aged 20–79 are currently diagnosed with diabetes. Projections indicate this number will increase to approximately 853 million (13%) by 2050 [1]. In China, the diabetes epidemic is particularly pronounced, with recent data showing that the number of adults with diabetes has reached about 148 million, ranking first worldwide and concentrated mainly among middle-aged and older adults [1, 2]. Diabetes not only severely affects patients’ quality of life but also imposes a substantial economic burden on individuals, families, and society [3–6]. With accelerating urbanization, population aging, and lifestyle changes, such as sedentary behavior and high-calorie diets, diabetes prevention and control face increasingly complex challenges. Therefore, identifying risk factors for diabetes is of major public health significance in order to curb its prevalence and improve population health. In addition to individual risk factors such as genetic susceptibility and diet, the impact of environmental factors, particularly heatwaves, on diabetes risk has gained increasing global attention. Potential biological mechanisms linking heatwave exposure to diabetes risk include high temperatures activating the hypothalamic–pituitary–adrenal (HPA) axis and sympathetic nervous system, leading to elevated levels of stress hormones such as cortisol and norepinephrine, which promote gluconeogenesis and induce insulin resistance [7]. Heat stress may also trigger dehydration, electrolyte imbalances, and systemic inflammation; these physiological disturbances collectively disrupt glucose homeostasis, further increasing diabetes risk [8]. Multiple epidemiological studies suggest a possible positive association between heatwave exposure and diabetes incidence [9, 10]. For instance, Xu et al. reported a significant increase in diabetes-related hospitalizations during heatwave periods [11], while Chen et al. found that heatwaves significantly increased the diabetes mortality burden across 31 Chinese cities, particularly among older adults [12]. Additionally, a global prediction model projects that each 1 °C rise in global temperature could result in more than 100,000 new diabetes cases annually worldwide [13]. However, findings remain inconsistent across studies, with some failing to observe statistically significant associations between heatwave exposure and diabetes risk [14–16]. This heterogeneity may stem from variations in thermal thresholds, heatwave duration, or the temperature metrics used to quantify heat intensity, thereby influencing effect estimates. As global warming intensifies, extreme heat events are becoming more frequent, prolonged, and widespread. Future projections suggest that many regions will experience heightened weather variability, exposing populations to cumulative heat stress far exceeding historical levels and amplifying public health risks associated with extreme temperatures, especially among middle-aged and older adults, whose thermoregulatory capacity declines with age [17]. In China, common practices such as morning exercises, outdoor labor, and evening social activities further increase actual heat exposure during peak-temperature seasons. At the same time, high urban population density and disparities in air conditioner access between urban and rural areas may reduce individual adaptive capacity, exacerbating disruptions to glucose homeostasis caused by heat exposure [18, 19]. Therefore, a comprehensive assessment of heatwave impacts on diabetes risk among middle-aged and older populations in China is imperative. Moreover, people are usually exposed to multiple environmental factors simultaneously; thus, understanding their interactions and collective impact on health is essential. Air pollution, particularly PM2.5, is a recognized diabetes risk factor. It may interact synergistically with heatwaves by inducing systemic inflammation and oxidative stress. A 4,551 participants demonstrated that each 10 µg/m3 increase in PM2.5 concentration raised the risk of prediabetes by 29%. Conversely, green space can mitigate or offset the harmful effects of heatwaves by providing local cooling and promoting physical activity [22]. The study by Ngom et al. [23] indicated that residents living farthest from green spaces had a 9% higher prevalence of type 2 diabetes mellitus (T2DM) compared with residents living closest to such areas. Consequently, when assessing the health impacts of heatwaves, it is important to consider the synergistic or antagonistic effects of other environmental factors to accurately evaluate actual public health risks. Given this context, the present study aimed to investigate the relationship between heatwave exposure and the risk of developing diabetes among middle-aged and elderly Chinese adults using CHARLS data. We proposed two hypotheses: first, heatwave exposure elevates diabetes risk among this population, and second, environmental factors, such as air pollution and green space availability, may modify this relationship. This research will expand empirical knowledge on climate change, enhance understanding of climate-related health risks, and provide critical insights for public health preparedness, adaptive measures, and targeted interventions. Data and methods Study design and population Data utilized in the current research originated from the CHARLS dataset. CHARLS represents a comprehensive, multidisciplinary, nationally representative survey coordinated by the National Development Institute at Peking University, in collaboration with the China Social Science Survey Center and the Youth League Committee at Peking University. The initiative primarily collects high-quality micro-level data on Chinese residents aged 45 and above, incorporating information at both individual and household levels. This dataset facilitates extensive research on population aging, encourages interdisciplinary collaborations, and supports evidence-based national policy formulation. Further details about the CHARLS project are described by Zhao et al. [24]. The current study utilized data from the third round (2015) and the fourth round (2018) of the CHARLS survey. Inclusion criteria were as follows: (1) age ≥ 45 years; (2) participation in both the 2015 and 2018 surveys; and (3) availability of complete information on diabetes status and related core variables. Exclusion criteria included: (1) self-reported or medically diagnosed memory impairments (such as dementia or intellectual deficits) or severe mental/psychological conditions; (2) existing diabetes diagnosis at baseline; and (3) abnormal or biologically implausible values in critical variables, such as BMI. The detailed screening process is illustrated in Fig. 1. Flow chart of participants A total of 6,591 participants who completed both survey rounds with complete data were ultimately included in this analysis. Because specific residential addresses were unavailable, environmental exposure levels were assessed at the city level. This study assumed that participants living within the same city shared identical exposure levels. Additionally, three assumptions were made regarding residential stability: (1) the cohort comprised middle-aged and elderly individuals (≥ 45 years), who generally have low residential mobility; (2) China’s household registration system imposes certain restrictions on migration; and (3) the interval between surveys was relatively short (3 years). All participants provided informed consent, and the study protocol received approval from the Ethics Review Committee of Peking University (Approval No.: IRB00001052–11,015). Assessment of diabetes T2DM diagnosis was determined according to internationally recognized criteria established in 2015. Participants were classified as diabetic if they met any of the following criteria: (1) self-reported diabetes or hyperglycemia diagnosis by a physician in the questionnaire; or (2) biochemical test results meeting at least one of the following thresholds: fasting plasma glucose (FPG) ≥ 7.0 mmol/L, glycated hemoglobin A1c (HbA1c) ≥ 6.5%, or random plasma glucose (RPG) ≥ 11.1 mmol/L. Venous blood samples were collected by the Chinese Center for Disease Control and Prevention (CDC) and stored consistently at − 80 °C prior to testing. FPG was measured using the glucose oxidase method, and HbA1c levels were quantified via high-performance liquid chromatography [26]. Assessment of heatwave exposure Meteorological temperature records utilized for this analysis were sourced from the Data Center for Resources and Environmental Sciences of the Chinese Academy of Sciences (https://www.resdc.cn/data.aspx) [27]. Currently, there is no unified definition of heatwave exposure. Thus, this study adopted the 90th, 92.5th, 95th, and 97.5th percentiles of daily maximum temperatures during the study period as city-specific thresholds. This approach followed previous literature and recommendations from the World Meteorological Organization (WMO) [28, 29, 30], considering regional climate characteristics and long-term population adaptability. These thresholds were combined with different duration criteria (≥ 2 days, ≥ 3 days, ≥ 4 days), resulting in 12 distinct heatwave definitions. For example, HW1 (90th-2D) refers to two consecutive days when daily maximum temperatures exceeded the 90th percentile (P90) of all daily maximum temperatures during the study period; specific details are provided in Table S1. To clearly distinguish the exposure indicators, we define heatwave days as the total number of individual days that meet the heatwave criteria during the study period (i.e., cumulative duration), whereas heatwave events refer to the number of discrete high-temperature periods that satisfy the same criteria (each continuous sequence of ≥ 2/≥3/≥4 heatwave days is counted as one event). These two metrics respectively capture the persistence and the frequency of heatwave exposure. Changes in heatwave exposure levels were used as the core exposure indicator. Specifically, the total number of heatwave exposure days and events experienced by each participant within the survey month and the preceding 11 months (12 months in total) were separately calculated for 2018 and 2015. Subsequently, the difference in exposure levels between 2018 and 2015 was computed and incorporated as a core exposure variable in the model to assess the association between heatwave exposure and diabetes risk. Assessment of air pollution and green space The PM2.5 data used in this study were obtained from the China High-Resolution and High-Quality Near-Surface Air Pollutants Dataset (CHAP). This dataset integrates multiple sources, including MODIS satellite-derived aerosol optical depth (AOD) inversion data and ground-based observations. Artificial intelligence methods were applied to fill spatial data gaps from satellite measurements. Specifically, the research team combined MODIS MAIAC AOD products with meteorological reanalysis data and anthropogenic emissions inventories, generating a PM2.5 dataset at a 1 km (approximately 0.01 × 0.01) spatial resolution [31, 32]. Green space availability was quantified through the Normalized Difference Vegetation Index (NDVI). NDVI information was acquired from the Moderate Resolution Imaging Spectroradiometer (MODIS) aboard NASA’s Terra satellite, using the Google Earth Engine (GEE) platform. The data had a spatial resolution of 500 m and a temporal resolution of 16 days, with NDVI values ranging between − 1 and 1, where higher values correspond to increased vegetation density [33, 34]. To assess temporal variations in environmental conditions, mean PM2.5 concentrations and NDVI levels were computed for the respective 12-month intervals preceding each survey wave (2015 and 2018). Covariates Analyses were adjusted for socio-demographic characteristics, health-related behaviors, and anthropometric measures. Baseline data from participants in 2015 were used, including gender (male/female), age (continuous variable), education level (illiterate, literate/primary incomplete, primary graduate, junior/high school, college or above), annual household per capita consumption expenditure (grouped by quartiles), marital status (married/other [divorced, widowed, unmarried, cohabiting]), place of residence (urban/rural), and geographic region (south/north of the Qinling-Huaihe line). Health-associated behaviors evaluated in this research included smoking habits (classified as current smoker, former smoker, or non-smoker), alcohol intake frequency (categorized into ≥ 1 time/month, < 1 time/month, or abstainer), and active participation in weight control, dietary regulation, or regular physical activity (yes/no). Variables related to participants’ health status comprised self-reported histories of chronic conditions (presence of one or more conditions such as hypertension, pulmonary disease, malignancy, cardiovascular disease, hepatic disease, renal disease, or asthma), body mass index (BMI, kg/m2, grouped as < 18.5, 18.5–23.9, or ≥ 24.0), serum triglyceride (TG, mmol/L), and high-density lipoprotein cholesterol (HDL-C, mmol/L). Additionally, this study analyzed transitions in smoking status (maintained, quitter/initiator), changes in drinking habits (unchanged, heavy to reduced/abstinent drinker, or light/abstinent to heavy drinker), and variations in weight management, dietary patterns, and exercise behaviors between 2015 (baseline) and 2018 (follow-up). This analysis aimed to clarify dynamic lifestyle changes over time. Directed Acyclic Graphs (DAGs) were used to select background factors and personal characteristic variables that may confound the association between heatwave exposure and disease outcomes (Fig. S1). Statistical analysis Continuous variables normally distributed were presented as mean ± standard deviation (SD), whereas skewed continuous variables were expressed as median (IQR). Categorical variables were presented as percentages (n, %). For between-group comparisons, continuous variables were assessed using the independent samples t-test (normally distributed data) or the Mann–Whitney U test (non‑normally distributed data); categorical variables were analyzed using the χ² test or Fisher’s exact test. This study employed the generalized Difference‑in‑Differences (G‑DiD) method to evaluate the causal relationship between heatwave exposure and diabetes risk. This approach used longitudinal data by comparing changes in heatwave exposure and diabetes outcomes for the same individual between the two surveys (2015 and 2018) to estimate the average treatment effect. Unlike the traditional binary “treatment–control” DiD design, G‑DiD accommodates continuous or multi‑level exposures, making it suitable for complex exposure patterns. Its core identification assumption is the additive time trend assumption, which posits that in the absence of exposure changes, the temporal trend in diabetes risk remains consistent across individuals. Compared with cross-sectional designs, G‑DiD controls for individual‑level time‑invariant confounders, thereby improving causal inference [35]. Within this framework, we calculated the change in heatwave exposure as ΔHeatwave Exposure = (heatwave days/events at the second visit) − (heatwave days/events at the first visit). Heatwave exposure was quantified using two metrics: cumulative heatwave days and frequency of heatwave events. To assess the impact of heatwave exposure on diabetes risk, we used a Generalized Additive Model (GAM) with a logit link to fit the binary outcome. The model incorporated spatial coordinates of surveyed cities and controlled for spatial autocorrelation using thin plate splines [37]. In the regression analysis, the independent variables were the change in heatwave days per 3‑day increase and the change in heatwave events per additional event; the dependent variable was whether an individual developed diabetes. The model adjusted for age, sex, education level, household consumption expenditure, marital status, residence, geographic region, baseline chronic disease history (hypertension, diabetes, lung disease, cancer, heart disease, liver disease, kidney disease, asthma), and changes during follow‑up in smoking, alcohol use, physical activity, body weight, and dietary control. To investigate whether the association between heatwave exposure and diabetes risk was influenced by other environmental factors or individual characteristics (effect modification), we conducted stratified analyses. Participants were categorized into two groups based on percentage changes in PM2.5 and NDVI values, calculated as: (Value at second visit – Value at first visit)/Value at first visit. A percentage change in PM2.5 below the median (− 20.39%) was classified as a high-level reduction; other changes were classified as low-level reductions or increases. Similarly, a percentage change in NDVI below the median (18.38%) indicated NDVI reduction or slight increase; all other changes represented increased NDVI values. Additionally, subgroup analyses by sex, age, and chronic disease status explored variations in the heatwave exposure–diabetes association. Effect modification between strata was assessed by calculating 95% confidence intervals (CIs) using the formula: , where β1 and β2 represent the estimates for the two groups, and SE1 and SE2 are their corresponding standard errors. All estimates were converted to odds ratios (ORs) and 95% CIs on the logarithmic scale. To validate the robustness of the main findings, we conducted several sensitivity analyses. Given the hierarchical clustering structure of the CHARLS sample (individuals nested within cities), supplementary analyses used a generalized linear mixed model (GLMM). Random intercepts at the city level accounted for potential heterogeneity (e.g., socioeconomic levels, healthcare availability, urban thermal environments). The GLMM estimated fixed effects of heatwave exposure while controlling random variation within the hierarchical structure, reducing spatial clustering bias and improving estimate reliability. Second, to mitigate potential effects of baseline health status, we excluded participants with major chronic diseases (hypertension, diabetes, heart disease, chronic lung disease, liver disease, kidney disease, cancer, asthma) at baseline. We then repeated the primary analysis in a relatively healthy population to test the independence of the observed association. Furthermore, we employed Cox regression analysis using time to first diabetes diagnosis as the outcome, with follow-up duration as risk time. Participants without diabetes at their last visit were censored. Covariates were consistent with the primary analysis. This approach estimated the long-term impact of heatwave exposure changes on diabetes incidence, expressed as hazard ratios (HRs). All analyses were performed using R software (version 4.4.1). Results Basic characteristics of participants Participants previously diagnosed with diabetes at baseline (2015) were excluded, resulting in 6,591 eligible individuals being incorporated into the subsequent analyses. Among these participants, 321 (4.86%) were newly diagnosed with diabetes during the follow-up interval. The mean age was 58.96 ± 9.06 years, and males comprised 48.79% of the sample. Compared with non-diabetic participants, those with diabetes were older, had a higher proportion of males, and generally had lower education levels. Diabetic participants were more likely to be current smokers and had higher rates of hypertension, heart disease, kidney disease, chronic lung disease, and dyslipidemia. Additionally, diabetic participants had significantly higher body mass index (BMI) and serum triglyceride (TG) levels. No significant differences were found in high-density lipoprotein cholesterol (HDL) levels. Detailed baseline characteristics are presented in Table 1. Table 2 summarizes the number of heatwave days (events) experienced by participants and changes in PM2.5 and NDVI in their cities within the survey month and the preceding 11 months for 2015 and 2018. Compared with 2015, participants experienced more heatwaves in 2018, with lower PM2.5 and higher NDVI values. Table 1Analysis of participant descriptive characteristicsVariablesNon-diabetes (n = 6270)Diabetes (n = 321) P Age M [Q1, Q3]58.8 (9.1)60.4 (8.8)0.002Gender (%) Male3087 (49.2)129 (40.2)0.002 Female3183 (50.8)192 (59.8)Marital (%) Married5663 (90.3)283 (88.2)0.241 Others [divorced, widowed, unmarried, cohabiting]607 (9.7)38 (11.8)Resident (%) City1549 (24.7)85 (26.5)0.514 Village4721 (75.3)236 (73.5)Education (%) Illiterate2430 (38.8)153 (47.7)0.011 Literacy/primary school graduation, primary school graduation1822 (29.1)73 (22.7) Junior/senior high school1827 (29.1)86 (26.8) College or above191 (3.0)9 (2.8)Smoking status at the present (%) Smoking at present3472 (55.4)206 (64.2)0.006 Quit1847 (29.5)71 (22.1) Never smoked.951 (15.2)44 (13.7)Drinking status (%) ≥ 1 time/month1817 (29.0)72 (22.4)0.017 < 1 time/month587 (9.4)26 (8.1) Never drink alcohol.3866 (61.7)223 (69.5)Smoking status(%) No change348 (5.6)17 (5.3)0.018 From no to yes1774 (28.3)68 (21.2) From yes to no4148 (66.2)236 (73.5)Per capita household consumption (%) Q11554 (24.8)94 (29.3)0.052 Q21584 (25.3)62 (19.3) Q31559 (24.9)88 (27.4) Q41573 (25.1)77 (24.0)Drinking status (%) No change4602 (73.4)233 (72.6)0.478 From no to yes1194 (19.0)68 (21.2) From yes to no474 (7.6)20 (6.2)Weight control (%) No change5631 (89.8)216 (67.3)0.001 From yes to no212 (3.4)26 (8.1) From no to yes427 (6.8)79 (24.6)Physical exercise (%) No change5465 (87.2)198 (61.7)0.001 From yes to no254 (4.1)38 (11.8) From no to yes551 (8.8)85 (26.5)Diet control (%) No change5396 (86.1)171 (53.3)0.001 From yes to no325 (5.2)41 (12.8) From no to yes549 (8.8)109 (34.0)Province (%) North3054 (48.7)148 (46.1)0.394 South3216 (51.3)173 (53.9)High blood pressure (%) No4694 (74.9)176 (54.8)0.001 Yes1576 (25.1)145 (45.2)Cancer (%) No6207 (99.0)314 (97.8)0.084 Yes63 (1.0)7 (2.2)Lung disease (%) No5544 (88.4)268 (83.5)0.010 Yes726 (11.6)53 (16.5)Liver disease (%) No5930 (94.6)300 (93.5)0.463 Yes340 (5.4)21 (6.5)Heart disease(%) No5431 (86.6)240 (74.8)0.001 Yes839 (13.4)81 (25.2)Kidney disease (%) No5788 (92.3)285 (88.8)0.029 Yes482 (7.7)36 (11.2)Dyslipidemia (%) No5466 (87.2)233 (72.6)0.001 Yes804 (12.8)88 (27.4)BMI M [Q1, Q3]23.66 (3.39)24.78 (3.37)0.001TG M [Q1, Q3]1.50 (0.92)1.78 (1.06)0.001HDL M [Q1, Q3]1.34 (0.30)1.32 (0.28)0.129Q1 0–98097.5, Q2 98097.5–196,195, Q3 196,195–294292.5, Q4 294292.5–392,390, BMI Body Mass Index, TG Triglycerides, HDL High-Density Lipoprotein Cholesterol Analysis of participant descriptive characteristics Q1 0–98097.5, Q2 98097.5–196,195, Q3 196,195–294292.5, Q4 294292.5–392,390, BMI Body Mass Index, TG Triglycerides, HDL High-Density Lipoprotein Cholesterol Table 2Heat wave days or events experienced by participants in the survey month and the preceding 11 monthsCharacteristicsNo. of subjects (mean ± SD)PM 2.54.41 ± 3.22NDVI0.74 ± 0.10Changes in the number of heatwave days (day), mean ± SD HW1 (90th-2D)31.17 ± 2.29 HW2 (90th-3D)22.98 ± 1.99 HW3 (90th-4D)14.12 ± 2.11 HW4 (92.5th-2D)6.47 ± 1.75 HW5 (92.5th-3D)25.22 ± 3.89 HW6 (92.5th-4D)17.8 ± 4.20 HW7 (95th-2D)10.37 ± 3.43 HW8 (95th-3D)4.05 ± 2.62 HW9 (95th-4D)20.59 ± 5.75 HW10 (97.5th-2D)13.96 ± 4.95 HW11 (97.5th-3D)7.77 ± 3.84 HW12 (97.5th-4D)2.57 ± 2.79Changes in the number of heatwave events (number of event), mean ± SD HW1 (90th-2D)7.41 ± 1.68 HW2 (90th-3D)5.97 ± 1.58 HW3 (90th-4D)3.97 ± 1.31 HW4 (92.5th-2D)2.22 ± 0.73 HW5 (92.5th-3D)4.43 ± 1.22 HW6 (92.5th-4D)3.38 ± 1.11 HW7 (95th-2D)2.10 ± 0.91 HW8 (95th-3D)1.01 ± 0.61 HW9 (95th-4D)2.89 ± 1.07 HW10 (97.5th-2D)2.10 ± 0.87 HW11 (97.5th-3D)1.23 ± 0.65 HW12 (97.5th-4D)0.52 ± 0.55 Heat wave days or events experienced by participants in the survey month and the preceding 11 months Association between heatwave exposure and diabetes incidence risk Figure 2 and Tables S2 and S3 illustrate the impact of heatwave exposure (days and events) on diabetes risk. In adjusted Model 4, increased heatwave days HW2 (90th-3D) significantly increased diabetes risk (OR = 1.160, 95% CI: 1.008–1.334). Similarly, increased heatwave events HW12 (97.5th-4D) definition significantly raised diabetes risk (OR = 1.224, 95% CI: 1.012–1.480). Adjusted odds ratio (OR; 95%CI) for the associated between heatwave exposure and diabetes risk. Note: (A) Association between heatwave days and diabetes risk. B Association between heatwave events and diabetes risk. Model 1: Adjusted for geographic coordinates, age, and sex. Model 2: Further adjusted for baseline education, marital status, per-capita household consumption, province, and residence type, based on Model 1. Model 3: Further adjusted for baseline self-reported cancer, dyslipidemia, heart disease, hypertension, kidney disease, liver disease, and lung disease, based on Model 2. Model 4 (fully adjusted model): Further adjusted for changes in diet control, drinking status, physical exercise, smoking status, and weight control, based on Model 3. HW1–HW12 were constructed using four temperature thresholds (90th, 92.5th, 95th, and 97.5th percentiles) combined with three minimum duration requirements (≥2, ≥3, and ≥4 consecutive days). Specifically, HW1–HW3 correspond to the 90th percentile with 2–4 days; HW4–HW6 to the 92.5th percentile with 2–4 days; HW7–HW9 to the 95th percentile with 2–4 days; and HW10–HW12 to the 97.5th percentile with 2–4 days. Modifying effects of PM2.5 and green space on Heatwave-Diabetes risk association As shown in Fig. 3 and Tables S4 and S5, this study examined the modifying effects of PM2.5 and green space (NDVI) on the relationship between heatwave exposure and diabetes risk. The results indicated that although the direction of some PM2.5 reductions or NDVI increases differed from expectations, the overall trend suggested that both air pollution and green space may modify this association. Areas with smaller reductions or increases in PM2.5 showed a higher diabetes risk under most heatwave definitions than areas with substantial PM2.5 decreases. This finding was statistically significant for HW7 (95th-2D; PInteraction = 0.018), HW8 (95th-3D; PInteraction = 0.038), HW9 (95th-4D; PInteraction = 0.046), HW10 (97.5th-2D; PInteraction = 0.019) and for heatwave events HW3 (90th-4D; PInteraction = 0.038). For NDVI, areas with a large NDVI increase had a lower heatwave-related diabetes risk than areas with a decrease or small increase. In heatwave-day analyses, HW1 (90th-2D; PInteraction = 0.007) and HW10 (97.5th-2D; PInteraction = 0.001) were significant. In heatwave-event analyses, HW3 (90th-4D; PInteraction = 0.008) and HW8 (95th-3D; PInteraction = 0.025) also reached significance. Air pollutant- or green-space-specific OR estimates (95%CI) for the association between heatwave exposure and diabetes incidence. Note: (A) Air pollutant-specific OR estimates for the association between heatwave exposure and diabetes incidence. B Green space-specific OR estimates for the association between heatwave exposure and diabetes incidence. All models were adjusted for age, sex, education, marital status, per-capita household consumption, province of residence, residence type, cancer, dyslipidemia, heart disease, hypertension, kidney disease, liver disease, lung disease, diet control, drinking status, physical exercise, smoking status, and weight control. HW1–HW12 were constructed using four temperature thresholds (90th, 92.5th, 95th, and 97.5th percentiles) combined with three minimum duration requirements (≥2, ≥3, and ≥4 consecutive days). Specifically, HW1–HW3 correspond to the 90th percentile with 2–4 days; HW4–HW6 to the 92.5th percentile with 2–4 days; HW7–HW9 to the 95th percentile with 2–4 days; and HW10–HW12 to the 97.5th percentile with 2–4 days. Subgroup analysis To examine whether population characteristics modified the association between heatwaves and new-onset diabetes, subgroup analyses were conducted by gender, age, and baseline chronic disease status (Fig. 4; Tables S5–S7). The association varied across subgroups. Men had a higher heatwave-related diabetes risk than women, with significant interactions for HW8 (95th-3D; PInteraction = 0.009), HW9 (95th-4D; PInteraction = 0.019), and heatwave events HW7 (95th-2D; PInteraction = 0.019). Compared with middle-aged adults, the elderly showed a higher diabetes risk after heatwave exposure, with significant interactions for HW1 (90th-2D; PInteraction = 0.034), HW7 (95th-2D; PInteraction = 0.035), HW8 (95th-3D; PInteraction = 0.049) and heatwave events HW4 (92.5th-2D; PInteraction = 0.041). Baseline chronic disease status also modified the association. Individuals with chronic diseases had a higher heatwave-related diabetes risk, whereas those without chronic diseases had a lower or even opposite trend under some heatwave definitions. Significant interactions were observed for HW2 (90th-3D; PInteraction = 0.016), HW10 (97.5th-2D; PInteraction = 0.001), HW11 (97.5th-3D; PInteraction = 0.032) and heatwave events HW10 (97.5th-2D; PInteraction = 0.011). Overall, men, the elderly, and individuals with chronic diseases were high-susceptibility groups for heatwave-related diabetes risk. Age, sex, or chronic disease specific OR estimates (with 95%CI) for the association between heatwave exposure and incident diabetes risk. Note: (A) Age-specific OR estimates for the association between heatwave exposure and diabetes incidence. B Sex-specific OR estimates for the association between heatwave exposure and diabetes incidence. C Chronic disease-specific OR estimates for the association between heatwave exposure and diabetes incidence. All models were adjusted for age, gender, education, marital status, per-capita household consumption, province of residence, residence type, cancer, dyslipidemia, heart disease, hypertension, kidney disease, liver disease, lung disease, diet control, drinking status, physical exercise, smoking status, and weight control. HW1–HW12 were constructed using four temperature thresholds (90th, 92.5th, 95th, and 97.5th percentiles) combined with three minimum duration requirements (≥2, ≥3, and ≥4 consecutive days). Specifically, HW1–HW3 correspond to the 90th percentile with 2–4 days; HW4–HW6 to the 92.5th percentile with 2–4 days; HW7–HW9 to the 95th percentile with 2–4 days; and HW10–HW12 to the 97.5th percentile with 2–4 days. Sensitivity analysis The results of the sensitivity analysis are presented in Fig. 5 and Tables S8–S10. The findings from the GLMM model were largely consistent with the main effect analysis. When heatwave days were defined as HW2 (90th-3D; OR = 1.052, 95% CI: 1.005–1.102) and heatwave events as HW12 (97.5th-4D; OR = 1.221, 95% CI: 1.012–1.473), greater heatwave exposure was significantly associated with an increased risk of diabetes onset (Table S8). After excluding participants with major chronic diseases at baseline, the overall results remained stable. Under specific heat definitions, the effect estimate for HW2 (90th-3D) remained statistically significant (OR = 1.102, 95% CI: 1.022–1.188) (Table S9). Additionally, the Cox proportional hazards model, using time to first diabetes diagnosis as the outcome, confirmed a positive association between heatwave exposure and diabetes risk. Specifically, hazard ratios were 1.150 (95% CI: 1.008–1.311) for HW2 (90th-3D), 1.277 (95% CI: 1.018–1.602) for HW11 (97.5th-3D), and 1.051 (95% CI: 1.009–1.095) for HW9 (95th-4D) (Table S10). Effect estimates of heatwave exposure on diabetes incidence under different statistical models. Note: Adjusted effect estimates (OR/HR, 95% CIs) for the association between heatwave exposure and diabetes incidence obtained from multiple statistical models. Panel (A) presents results from GLMM; Panel (B) shows results from GAM, excluding participants with baseline chronic diseases; Panel (C) displays results from Cox proportional hazards models. All models were adjusted for age, gender, education, marital status, per-capita household consumption, province of residence, residence type, cancer, dyslipidemia, heart disease, hypertension, kidney disease, liver disease, lung disease, diet control, and drinking status. HW1–HW12 were constructed using four temperature thresholds (90th, 92.5th, 95th, and 97.5th percentiles) combined with three minimum duration requirements (≥2, ≥3, and ≥4 consecutive days). Specifically, HW1–HW3 correspond to the 90th percentile with 2–4 days; HW4–HW6 to the 92.5th percentile with 2–4 days; HW7–HW9 to the 95th percentile with 2–4 days; and HW10–HW12 to the 97.5th percentile with 2–4 days. Discussion Under specific heatwave definitions HW2 (90th–3D) and HW12 (97.5th–4D), this study identified an association between heatwave exposure and increased diabetes risk among middle-aged and older adults. This finding aligns broadly with previous domestic and international research reporting adverse effects of high temperatures or heatwaves on metabolic health [13, 38, 39]. But also other studies have failed to detect such associations or reported inconsistent results [14, 15]. For instance, a study in Michigan, USA, found no significant relationship between extreme heat and diabetes hospitalizations [40]. Similarly, a large-scale California analysis indicated regional and climate-specific variations in the heatwave-diabetes hospitalization relationship, with unstable effects for certain temperature indicators or short exposure windows [41]. Compared to these studies, our research utilized 12 heatwave definitions, systematically assessing combined effects of temperature intensity and duration. This approach increased the likelihood of identifying exposure patterns reflective of both “cumulative stress” and physiological relevance (e.g., low-intensity cumulative effects in HW2 or long-duration extreme-intensity effects in HW12). Additionally, our study population was derived from the CHARLS, specifically targeting new-onset diabetes cases. Previous studies primarily investigated diabetes-related hospitalizations, emergency visits, or acute exacerbations. Variations in study populations, healthcare access, and outcome sensitivity might explain differing results across studies. Using a multi-definition heatwave system, this study comprehensively evaluated how heatwave exposures varying in intensity and duration may influence the risk of developing diabetes among middle-aged and older adults. The findings suggest that heatwave exposure may serve as a potential environmental risk factor for incident diabetes, providing preliminary evidence of an association between heatwaves and diabetes onset in this population. This study found that air pollution may amplify the association between heatwaves and the risk of developing diabetes. Previous studies indicated [42, 43] that long-term exposure to PM2.5 increases the risk of T2DM. A prospective cohort study in China reported [44] that each 10 µg/m³ increase in PM2.5 raises T2DM risk by approximately 15.7%. Moreover, a Global Burden of Disease study [45] revealed that a considerable portion of the T2DM burden in China is attributable to air pollution exposure. Our findings suggest a stronger association between heatwave exposure and diabetes incidence in areas where PM2.5 concentrations either slightly decreased or remained high. This indicates that air pollution may interact with high temperatures to elevate the risk of metabolic disorders. Potential mechanisms include PM2.5-induced systemic inflammation, oxidative stress, endothelial dysfunction, and damage to pancreatic beta cells, leading to reduced insulin sensitivity and disrupted glucose homeostasis. When high-temperature exposure coincides with pollution-induced metabolic damage, an individual’s metabolic reserve is further compromised, impairing glucose metabolism regulation and increasing diabetes susceptibility [46]. Although current research on interaction pathways between heatwaves and air pollution remains limited, the overall trend suggests that heatwave hazards may increase in environments with higher air pollution levels. Future research should therefore address combined exposure effects of heatwaves, air pollution, and metabolic chronic diseases. Integrating temperature and air quality management would more effectively prevent and control diabetes risks linked to environmental factors. In addition, green spaces demonstrated a potential protective effect in this study. Compared to areas with decreased NDVI, adverse effects of heatwaves were relatively mitigated in regions where NDVI increased. A rural cohort study in Henan, China reported [47] that residential green space negatively correlates with T2DM risk. Each interquartile range increase in NDVI corresponded to a 13.4% reduction in diabetes risk. The protective effect of green spaces was more pronounced among men and older adults. Similarly, research from Australia showed [48] that higher residential greenery coverage significantly relates to a lower T2DM risk. Green spaces may mitigate heatwave impacts on diabetes through several mechanisms. First, green spaces reduce local temperatures via transpiration and shading, thereby lowering heat exposure [49]. Second, green spaces indirectly improve environmental conditions (e.g., adsorbing air pollutants) and encourage healthier behaviors (e.g., providing venues for physical activity and social engagement), thus reducing diabetes incidence [50]. Furthermore, exposure to natural environments has been proven effective in alleviating psychological stress and enhancing sleep quality, both critical psychophysiological factors for maintaining glucose homeostasis [22]. Therefore, in urban planning, the layout of green spaces should be further optimized in residential areas frequently used by middle-aged and elderly populations. For example, increasing the number of shade trees, expanding green coverage, and establishing pocket parks in older neighbourhoods, parks, and community pathways can enhance cooling effects in walking environments. Additionally, reducing local heat island effects through measures such as implementing green isolation belts or using high-reflectance paving materials can effectively lower heat exposure during high-temperature periods, thereby mitigating the potential impact of heatwaves on diabetes risk in urban areas. Subgroup analyses revealed that men, elderly individuals, and patients with chronic diseases faced a higher diabetes risk under heatwave exposure. Compared to females, men had a greater risk of developing diabetes during heatwaves, potentially due to higher outdoor activity, differences in body fat distribution, and lack of estrogen’s protective effects [51, 52]. The elderly were more vulnerable to metabolic imbalances during heatwaves due to reduced thermoregulatory capacity, decreased cardiovascular reserve, and a greater comorbidity burden. Similarly, Mou et al. [29] found older adults (≥ 60 years old) were at higher risk of cardiovascular and metabolic multimorbidity during extreme temperature events. Patients with chronic diseases also have fragile metabolic homeostasis, making heatwaves a significant trigger for blood glucose fluctuations [53]. Therefore, when formulating early warning and intervention strategies, it is essential to strengthen heatwave health management for elderly and high-risk diabetic populations. For instance, a registry of heatwave-sensitive groups among middle-aged and older adults could be established. Health reminders, such as increasing blood glucose monitoring frequency, adjusting antihyperglycemic medication schedules, and avoiding outdoor activities during peak heat, should be disseminated during extreme heat events. Concurrently, primary healthcare institutions should implement specialized follow-up services in summer, prioritizing patients with historically unstable glucose levels or multiple chronic conditions. These measures would enhance health education and improve early risk identification during heatwaves. In the context of climate change, these findings hold significant implications. As global temperatures rise, heatwaves are expected to become more frequent and prolonged, potentially increasing the future burden of metabolic diseases such as diabetes, especially among vulnerable elderly populations. Heatwaves may induce diabetes through pathways involving elevated stress hormones, fluid loss, and enhanced inflammatory responses [54]. Older adults, individuals with chronic diseases, and residents of disadvantaged environments are particularly sensitive to these physiological stressors. Additionally, alterations in traditional lifestyle factors, such as diet, physical activity, and sleep patterns, may interact with heatwave exposure; for example, extreme heat-induced reductions in physical activity and sleep quality could further aggravate metabolic imbalances. This highlights the necessity for future studies to systematically evaluate interactions between climate exposures and behavioral determinants. At the policy level, integrating climate adaptation strategies with chronic disease prevention systems should be prioritized. Measures could include incorporating diabetes high-risk group management into heatwave early warning protocols, optimizing green space distribution and shade facility layouts, and improving cooling infrastructure in aging communities. These actions aim to mitigate heatwave impacts on metabolic health under evolving climate scenarios. This study has several limitations that should be carefully considered when interpreting the results. First, temperature exposure was estimated based on city-level environmental monitoring data, without precise individual residential locations and daily exposure details. This may cause non-differential exposure misclassification, affecting the precision of effect estimates. Second, the study assumed that participants’ residences remained relatively stable during follow-up. Although migration rates among middle-aged and older adults are low, biases from relocation cannot be completely excluded. Third, despite adjusting for various confounders, unmeasured or residual confounding factors (such as indoor temperature, air conditioning use, and dietary patterns) may remain. Additionally, self-reported disease information such as comorbidities could introduce recall bias. Finally, since the CHARLS sample has distinct social and regional characteristics, caution is needed when generalizing findings to other regions of China or different climatic contexts. Despite these limitations, the study also has notable strengths. First, employing a G-DiD design effectively controls for time-invariant confounding factors. Second, systematically analyzing the impact of heatwaves using twelve different definitions, varying in intensity and duration, strengthens the robustness of the results. Third, examining the modifying effects of environmental factors (PM2.5 and green space) provides novel insights into the interactive health impacts of multiple environmental exposures. Additionally, the CHARLS dataset provides a nationally representative sample of middle-aged and older adults. However, future research should further explore the causal pathways linking heatwave exposure to diabetes risk. Conclusion Using CHARLS data, this study shows that heatwave exposure is significantly associated with increased diabetes risk, particularly under definitions HW2 and HW12. Elevated PM₂.₅ levels or limited reductions in air pollution amplified this association, whereas higher NDVI demonstrated a protective modifying effect. Men, older adults, and individuals with baseline chronic conditions were more vulnerable to heatwave-related diabetes risk. Given ongoing climate change, strengthening heatwave early-warning systems, improving air quality management, expanding urban greening, and implementing targeted interventions for high-risk groups are essential. Future research should incorporate multicenter prospective cohorts, individual-level exposure assessments, and biomarker data to validate these findings and clarify the physiological and molecular pathways linking heatwaves to impaired glucose metabolism. Supplementary Information Supplementary Material 1. Acknowledgements We would like to acknowledge the China Health and Retirement Longitudinal Study (CHARLS) team for providing data and the training of using the dataset. This study was completed based on the publicly available longitudinal survey database, the China Health and Retirement Longitudinal Study (CHARLS), and is not a clinical trial, therefore, no clinical trial registration number was obtained. Abbreviations China Health and Retirement Longitudinal Study Generalized additive models Generalized difference-in-differences Fine particulate matter Normalized Difference Vegetation Index Hypothalamic–pituitary–adrenal Type 2 diabetes mellitus Fasting plasma glucose Glycated hemoglobin A1c Random plasma glucose Chinese Center for Disease Control and Prevention World Meteorological Organization 90th percentile China High-Resolution and High-Quality Near-Surface Air Pollutants Dataset Aerosol optical depth Moderate Resolution Imaging Spectroradiometer Google Earth Engine Body mass index High-density lipoprotein cholesterol Directed Acyclic Graphs Standard deviation Confidence intervals Standard errors Odds ratios Generalized linear mixed model Hazard ratios Authors’ contributions WY: Conceptualization; Study design; Data curation; Formal analysis; Writing – original draft; Writing – review & editing. YL: Conceptualization; Study design; Writing – review & editing. CY: Writing – review & editing. XZ: Writing – review & editing. XJ: Conceptualization; Study design; Supervision; Methodological guidance; Writing – original draft; Writing – review & editing. Funding This study was supported by the National Natural Science Foundation of China Youth Science Fund Project (82304262), the grant from China Scholarship Council (202408460019), and the Joint Program on Health Science & Technology Innovation of Hainan Province (WSJK2024MS133). Data availability This study uses publicly available data from the China Health and Retirement Longitudinal Study. The raw data can be accessed through the following link: https://charls.pku.edu.cn/. Declarations Ethics approval and consent to participate The study was approved by the Biomedical Ethics Committee of Peking University (Approval No: IRB00001052-11015; IRB00001052-11014) and strictly adhered to the ethical principles outlined in the Declaration of Helsinki. All participants provided written informed consent, ensuring the ethical compliance of the data collection process and the protection of participants’ rights. Consent for publication Not applicable. Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Supplementary Materials Supplementary Material 1. Data Availability Statement This study uses publicly available data from the China Health and Retirement Longitudinal Study. The raw data can be accessed through the following link: https://charls.pku.edu.cn/.