The research found that increasing the amount of time spent fasting overnight reduces blood sugar levels and in turn, reduces the risk of both diseases.
A total of 2,212 female participants recorded their eating and sleeping patterns for a year under the study, which was conducted by scientists at the University of California.
Upon analysing their data, the researchers found that for every three hours of extra fasting per night, participants were 20% less likely to suffer from high blood sugar.
It is thought high or unstable blood sugar levels may be linked to an increased risk of cancer and diabetes.
"Increasing the duration of overnight fasting could be a novel strategy to reduce the risk of developing breast cancer," Catherine Marinac, lead author of the latest paper said in a statement.
"This is a simple dietary change that we believe most women can understand and adopt. It may have a big impact on public health without requiring complicated counting of calories or nutrients."
The research is published in the journal Cancer Epidemiology, Biomarkers & Prevention.
Previous research has suggested that women who work on night shifts - who are more likely to eat at night - have an increased risk of breast cancer.
Researchers from Queen's University in Canada found that women who had worked for 30 or more years on the night shift had a doubled risk for developing breast cancer compared with women who worked 29 or fewer years during nights.
Co-author of the University of California study, Ruth Patterson, said: "The dietary advice for cancer prevention usually focuses on limiting consumption of red meat, alcohol and refined grains while increasing plant-based foods.
"New evidence suggests that when and how often people eat can also play a role in cancer risk."
H/T: The Telegraph