# Visual Basic > Universal Windows Platform and Modern Windows Experience >  [RESOLVED] DatePicker maxYear

## met0555

Hi, 

I have a Datepicker on my xaml page and i'm trying to assign the maxYear that it should accept by using the Properties toolbox, but i'm getting the following error : 


```
Error 1 Cannot assign text value '2035-12-12 -05:00' into property 'MaxYear' of type 'DateTimeOffset'
```

from 12/12/2113 7:43 PM -05:00
trying to 12/12/2035 7:37 PM -05:00

Thank You

----------


## met0555

I manage to make it work, instead of changing the value in the properties window, i did it programatically like this



```
 Dim date2 As DateTimeOffset
        date2= "12/12/2035"
        datepicker1.MaxYear = date2
```

----------

