In Pokémon games featuring a Safari Zone with Riolu (e.g., Pokémon Diamond/Pearl/Platinum – Great Marsh; HeartGold/SoulSilver – Safari Zone west of Cianwood):
Riolu can appear at ANY time of day or night. Its encounter rate is not time-dependent.
However:
Patience and manipulation of Safari Zone mechanics (baiting, area customization) matter more than time of day.