What is wrong these dates?

dim d as new date
d.gmtOffset = -7
today = d()
todayPlus7 = d()
todayPlus7.day = todayPlus7.day + 7
msgbox str(today) + endofline + str(todayPlus7)

run on 2016-06-17 gives me:

2016-06-24 22:36:07
2016-06-24 22:36:07

Why is this happening? Is this a bug?

today & todayplus7 are referencing the same date object, so making changes to one will reflect in the other. You need to use New Date for dateplus7 & then set it’s totalseconds = today.totalseconds.

Thanks. This worked:

dim d as new date
d.gmtOffset = -7
today = d()
dim e as new date
todayPlus7 = e()
todayPlus7.day = todayPlus7.day + 7
msgbox str(today) + endofline + str(todayPlus7)