# Change value, 6 hour after the last write

**URL:** <https://forum.genieacs.com/t/change-value-6-hour-after-the-last-write/3232>\
**Category:** Uncategorized\
**Created:** [November 25, 2022, 2:00pm UTC](https://forum.genieacs.com/t/change-value-6-hour-after-the-last-write/3232 "2022-11-25T14:00:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vang1804](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/vang1804/32/1003_2.png) [@vang1804](https://forum.genieacs.com/u/vang1804)\
**Post date:** [November 25, 2022, 2:00pm UTC](https://forum.genieacs.com/t/change-value-6-hour-after-the-last-write/3232/1 "2022-11-25T14:00:44Z")

</div>

Hello everyone…  
I am a little bit confused! 😃

I have created a Virtual Parameter that activates/deactivates remote access to the CPE and on update get the values from the CPE.

I want to disable the remote access … 6 hours after the last change…

Is this valid?  
declare(“VirtualParameters.RemoteAccess”, (Date.now() - ( 6 \* 60 \*60 \* 1000)), {value: false});

Thank in advance!  
Vangelis

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [November 28, 2022, 7:48pm UTC](https://forum.genieacs.com/t/change-value-6-hour-after-the-last-write/3232/2 "2022-11-28T19:48:27Z")

</div>

Close:

```auto
const sixHoursAgo = Date.now() - (6 * 60 * 60 * 1000);
declare("VirtualParameters.RemoteAccess", {value: sixHoursAgo}, {value: false});

```

---

<div class="post-metadata">

**Author:** ![vang1804](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/vang1804/32/1003_2.png) [@vang1804](https://forum.genieacs.com/u/vang1804)\
**Post date:** [November 30, 2022, 4:12pm UTC](https://forum.genieacs.com/t/change-value-6-hour-after-the-last-write/3232/3 "2022-11-30T16:12:51Z")

</div>

😃 Thank you very much!!
