Skip to main content
12 events
when toggle format what by license comment
May 23, 2017 at 11:33 history edited CommunityBot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Apr 19, 2011 at 15:41 history edited Grant Thomas CC BY-SA 3.0
added 509 characters in body; edited body; added 57 characters in body
Apr 19, 2011 at 15:38 comment added Grant Thomas @Timwi: Or by two lines, if you return instead of assigning timePeriod.
Apr 19, 2011 at 15:33 comment added Grant Thomas @Timwi: Early hours of morn obviously had their way - I agree this could be shorter, by a single line.
Apr 19, 2011 at 15:30 comment added Timwi I don’t get why you declare that extra variable timeDifference for one of the ?: cases but not the other; and why you declare it negative. Why not just var timePeriod = currentTime.Hour >= hour ? (desiredTime.AddDays(1) - currentTime) : (desiredTime - currentTime)?
Apr 19, 2011 at 12:52 vote accept juan
Apr 19, 2011 at 7:50 history edited Grant Thomas CC BY-SA 3.0
added 1 characters in body
Apr 19, 2011 at 7:47 comment added Grant Thomas Oops, good spot - misinterpreted your comment at first, a simple mistake and fix, a >= check would suffice, in that case. Let me update that.
Apr 19, 2011 at 7:18 comment added Snowbear your currentTime.Hour > hour doesn't take minutes/seconds into account, i.e. 12:55 is also after midday
Apr 19, 2011 at 1:15 history edited Grant Thomas CC BY-SA 3.0
added 2 characters in body
Apr 19, 2011 at 0:49 history edited Grant Thomas CC BY-SA 3.0
added 445 characters in body
Apr 19, 2011 at 0:43 history answered Grant Thomas CC BY-SA 3.0