Get current date and time

133 views
Skip to first unread message

Timothy Leung

unread,
Jun 13, 2021, 1:28:06 AM6/13/21
to mementodatabase
Hello, 

I wish to get the current date & time and assign it to a Date field and Time field. How can I do that ?

Bill Crews

unread,
Jun 13, 2021, 1:47:15 AM6/13/21
to Timothy Leung, mementodatabase
A Date or DateTime field has a default value of no date, but there is a checkbox for using the current date instead. Check the box.

In a trigger or action script...
    entry().set("Today's date", Date.now());


On Sun, Jun 13, 2021, 1:28 AM Timothy Leung <thtl...@gmail.com> wrote:
Hello, 

I wish to get the current date & time and assign it to a Date field and Time field. How can I do that ?

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/7ab43cf7-b638-4c29-8c20-9fe9a5c2aaa3n%40googlegroups.com.

Timothy Leung

unread,
Jun 13, 2021, 2:30:09 AM6/13/21
to mementodatabase
Thanks Bill for the input. I am trying to create a record in database A from a trigger script in database B using info in database B's record that I'm editing. Would the default values in database A's new record still apply in this case?

Bill Crews

unread,
Jun 13, 2021, 10:06:13 AM6/13/21
to Timothy Leung, mementodatabase
If you want it to match B's date & time, copy it over. If you want a fresh date as of now, let it do that for you.

Timothy Leung

unread,
Jun 13, 2021, 1:16:27 PM6/13/21
to mementodatabase
Thank you, it's working fine now.
Reply all
Reply to author
Forward
0 new messages