# How to set a variable to today value

**URL:** https://www.finalbuilder.com/forums/t/how-to-set-a-variable-to-today-value/1511
**Category:** Discussion
**Created:** [June 25, 2010, 2:20am UTC](https://www.finalbuilder.com/forums/t/how-to-set-a-variable-to-today-value/1511 "2010-06-25T02:20:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 25, 2010, 2:20am UTC](https://www.finalbuilder.com/forums/t/how-to-set-a-variable-to-today-value/1511/1 "2010-06-25T02:20:31Z")

</div>

Hi,

I am new for FinalBuilder and I have a question maybe very simple.

I try to defind a vairable call "TodayFolder" which is today value with format: yyyymmdd.

And I try to define a variable in javascript like this:

------------------------------------------------------------

```
var d = new Date();var curr_date = d.getDate();var curr_month = d.getMonth();var curr_year = d.getFullYear();var todayStr = curr_year + curr_month + curr_date;
```

------------------------------------------------------------

But how can I set the "TodayFolder" = todayStr?

Cheers,

&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [June 25, 2010, 3:52am UTC](https://www.finalbuilder.com/forums/t/how-to-set-a-variable-to-today-value/1511/2 "2010-06-25T03:52:40Z")

</div>

FinalBuilder variables can be referenced in script without declaring them. Also, there is a Get DateTime actions that will do this without needing to use script.

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 25, 2010, 7:53am UTC](https://www.finalbuilder.com/forums/t/how-to-set-a-variable-to-today-value/1511/3 "2010-06-25T07:53:34Z")

</div>

Excellent! This is exact what I&nbsp;want!

Thank you very much!

&nbsp;
