Copy link to clipboard
Copied
I have a date something like this below. I want to convert it so that I can put it into a text field. Anyone know how to do this? Thanks.
var currentDate=new Date();
var month = currentDate.getMonth() + 1;
var day = currentDate.getDate();
var year = currentDate.getFullYear()
trace(month + "/" + day + "/" + year);
embed your font.
Copy link to clipboard
Copied
use:
var currentDate=new Date();
var month = currentDate.getMonth() + 1;
var day = currentDate.getDate();
var year = currentDate.getFullYear()
your_textfield.text=month + "/" + day + "/" + year;
Copy link to clipboard
Copied
i am using a Dynamic Text field and I get an empty box when I use that. However if i put a word in quotes "Hello" it shows up no problem.
EDIT
if I open a new document and use that code it works perfectly. Just not in the document I am working on. Any ideas why that would be?
Copy link to clipboard
Copied
embed your font.
Copy link to clipboard
Copied
Thanks
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now