Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Using Tap Forms › How to assign current date in script
I try to assign the current date to a field using a script.
Doesn’t show anything. If I change date_sold to a text field it works. Then I tried to get the date number:
Doesn’t work either. But something like this works:
When using a script, how can I assign the current date to a field? Thanks!
The problem with the Date() function is it’s returning the date as a String. And you’re trying to set that on a Date field.
So what you need to do is use:
var currentDate = new Date();
I just tested it and it works. Internally the new Date() function will convert to an NSDate which is what Tap Forms needs for setting on the field.
Perfect, this works for me too! Thank you for your help.
You must be logged in to reply to this topic.
Log in / Register