photosensor activates led's based on day/night

Hello, I need some kind of structure or example for code for the following. A photosensor will detect if its day or night. If i push a button and it detects that its day, a Green LED will momentarily flash. If its nighttime and you are pushing the same button , a Red LED will momentarily flash. Thanks so much

You can refer to this tutorial