I want to implement day/night functionality on world map i.e there will be   dark layer showing countires having night now.  This world map could be creaeted through ESRI or SVG map.I want to understand what is the   logic of showing behind implementing this.Any known algorithms/formulas.  I have posted this question in stackoverlfow ().  But thought this is better forum.
I have a daytime raster of my study area. I have 20+ counters in the study area that count "stuff" with a timestamp. Using  I determined the type of ambient light for each collected data point.   What I'd like to do:   Add a grey/semi transparent overlay to reflect the ambient light (Dusk, Sunrise, day, sunset, and dark). The end goal: produce a time-based visualization of the data collection that highlights the time of the day. Or be able to produce a snapshot at a certain time with the proper shaded overlay. Think of this as this the image:
was created on Server Fault, answered on Server Fault, I upvoted some of those answers on Server Fault, and then moved by consensus to Super User.  Now that the question is on Super User, I can upvote the same answers I previously upvoted on Server Fault.