Community

Insert date Answered

Hi ,

I have a blank field and want to have current date and time in it. Can anyone tell me.

Was this article helpful?

0 out of 0 found this helpful

Comments

2 comments

  • Avatar
    Permanently deleted user

    Hi Samir, 

    Set the field datatype to Date. Then add a C# script rule to getdate and assign it to the field. See script below.

     

    using System;

    DateTime thisDay = DateTime.Today;

    Context.Field("Field").Text = thisDay.ToString("d");

    1
  • Avatar
    Samir Waikar

    Thanks collins. 

    0

Please sign in to leave a comment.