I don't believe that time makes a difference for the coffee retention enema. However if you take a cleasing enema before the coffee enema, it should be at least three hours after eating.
Personally I prefer to do the cleansing enemas in the morning after my normal bowel movement and wait for another hour then take my coffee enema.
However often this schedule is no convenient for me and I postpone the cleasing enemas until the evening and skip eating dinner. Then I take the coffee retention enema just before going to bed. You must give yourself enough time to take the enema, retain it for 20 minutes, expel it completely before going to sleep.