0

A couple of days ago I created a career stackoverflow profile. I'm looking daily to see if anyone has visited my profile. It says

this week 7 visits, today 3

How is this counting? If I'm not wrong in other places/countries week starts on Sunday, here it starts at Monday. And what about timezones? When it says today it means past midnight at which timezone? I guess it isn't locally.

3
  • 1
    Stack Exchange uses UTC time.
    – juergen d
    Commented Dec 22, 2013 at 19:42
  • 1
    I'd assume "this week" means "within the last seven days"
    – ThiefMaster Mod
    Commented Dec 22, 2013 at 20:09
  • @ThiefMaster Thnx I guess this is obvious for some of you. Commented Dec 22, 2013 at 20:14

1 Answer 1

2

This is the code used to generate these time periods.

var now = DateTime.UtcNow;
var thisMonth = now.AddDays(-30);
var thisWeek = now.AddDays(-7);
var today = now.AddDays(-1);

Since this is just candy data and not used as input to any other function, we just do a quick and dirty calculation.

3
  • Your hat is misplaced a bit :) Commented Dec 23, 2013 at 11:11
  • @ShadowWizard how's that? :)
    – Nick Larsen Mod
    Commented Dec 23, 2013 at 12:57
  • Much better, and fitting! ;) Commented Dec 23, 2013 at 13:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .