Factors associated with nocturnal and diurnal glycemic variability in patients with type 2 diabetes: a cross-sectional study