Default date to today

I want to default my date field to today. I have tried a number of things the one that I thought looked most hopeful is this:
[[Now.getDate()]]/[[Now.getMonth()]]/[[Now.getFullYear()]]. But this and other attempts have failed abysmally.

It must be simple, I just can’t get it!

Thank you…liz

[[Now.toISOString().substr(5,2)]]/[[Now.toISOString().substr(8,2)]]/[[Now.toISOString().substr(0,4)]]

should do it.

2 Likes

if you use Chrome you may want to use yyyy-mm-dd format for date fields. Using Gregor’s example = [[Now.toISOString().substr(0,4)]]-[[Now.toISOString().substr(5,2)]]-[[Now.toISOString().substr(8,2)]]

2 Likes

Thank you both… what is different about Chrome?

Strelec,

This works well, thank you. It’s a biy annoying dates are such a standard requirement you’d think Axure could give us something simple like Now() or Today()!!!

liz

Hi Liz,
there is [[Now.toLocaleDateString()]] if it works out better for you
Not sure why chrome is different when it comes to date fields - i guess every browser has it’s own tweaks. We can’t change it, so we just have accept it :slight_smile:

1 Like

Indian Format : it will set today date in a text field
STEP 1 - Drag Drop text field from default>Forms , name it ‘today’ or whatever you want
STEP 2- Select text field, click on properties, select OnLoad
STEP 3 : set text to value =
"
[[Now.toISOString().substr(8,2)]]
/
[[Now.toISOString().substr(5,2)]]
/
[[Now.toISOString().substr(0,4)]]

"

OUTPUT : 20/08/2018

FOR MORE DETAILS : visit Common Date Formats

as today is this date… my signup :slight_smile: