What year does Portal and its sequel, Portal 2, take place in?
According to the timeline on Half Life's Wikia, Portal takes place around 2010. However, I could not find a reference to an exact date.
Going by the same sources, and this question, Portal 2 takes place hundreds of years after Portal. Again, I could not find a reference to an exact date.
Note that there is no official source of an exact date. Looking at other sources (including the talk pages on the Half Life Wikia timeline page) you can see a lot is based on fragmented, and often speculated, details.
Because Portal and Portal 2 are very much isolated environments from the outside world, there isn't a great deal of concern with trying to fix the timelines to real dates. We know that Portal 2 provides a lot of backstory to events prior to Portal, and that Portal 2 occurs a long time after Portal.
I'm surprised that the systems in place during Portal 2 can actually see past the year 2038.