# How to send via formOutput the automatically set date(today)

**URL:** <https://community.ofelia.com/t/how-to-send-via-formoutput-the-automatically-set-date-today/9097>\
**Category:** Q&A\
**Created:** [22 May 2018 17:17 UTC](https://community.ofelia.com/t/how-to-send-via-formoutput-the-automatically-set-date-today/9097 "2018-05-22T17:17:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Silkroad\_Online\_1367](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@Silkroad\_Online\_1367](https://community.ofelia.com/u/Silkroad_Online_1367)\
**Post date:** [22 May 2018 17:17 UTC](https://community.ofelia.com/t/how-to-send-via-formoutput-the-automatically-set-date-today/9097/1 "2018-05-22T17:17:07Z")

</div>

Hey guys,  
I’m new to bonity and have trouble with a date picker. I have a form with a date picker, which is set to read-only because I want to just set the date automatically.

So at this time my value of the date picker is set to “formInput.bvar\_ManuskriptEinsendenInput.eingereichtAm”, which is of course wrong, because I dont want the client to choose the date. “eingereichtAm” is my date-variable:  
[https://image.ibb.co/bApEao/d3w2.png](https://image.ibb.co/bApEao/d3w2.png)

So I tried to set this variable in my formOutput, but its of course wrong:  
[https://image.ibb.co/cJVbo8/dascsadf.png](https://image.ibb.co/cJVbo8/dascsadf.png)  
Is there a way to set and pass the variable “eingereichtAm” through formOutput?

Can sb. help me, dont know how to set it automatically 😕

---

<div class="post-metadata">

**Author:** ![Dibyajit.Roy](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dibyajit.Roy](https://community.ofelia.com/u/Dibyajit.Roy)\
**Post date:** [22 May 2018 17:49 UTC](https://community.ofelia.com/t/how-to-send-via-formoutput-the-automatically-set-date-today/9097/2 "2018-05-22T17:49:03Z")

</div>

Hello  
I may have misunderstood your question ,  
But here is a solution that I would use.  
In your UI designer, Select create Variable.  
the type should be java script expression.  
use "return new Date(); to get current date and time.  
Now you can do formInput.variable = javascriptVariable  
and in your widget, set value as javascriptVariable

This would assign Current Date to your widget.

Regards

---

<div class="post-metadata">

**Author:** ![Silkroad\_Online\_1367](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@Silkroad\_Online\_1367](https://community.ofelia.com/u/Silkroad_Online_1367)\
**Post date:** [22 May 2018 19:20 UTC](https://community.ofelia.com/t/how-to-send-via-formoutput-the-automatically-set-date-today/9097/3 "2018-05-22T19:20:41Z")

</div>

This is totally embarrassing… I assumed that this would not work.  
Thanks alot! It works now.  
I had two mistakes. 1. I tried something like: formInput.variable = $javascriptVariable. But its like u said, without the $ and 2. I wrote return Date.now(); and this also didnt work, only return new Date();  
Thank you very much!
