Community

I want to get System date in one of the field Answered

Hi,

I need to get only the System Date in one of field, How can i do that??

Present i am using the below script, here i am getting date along with time also but i don't need time. Help me..

 

using System;

using System.Globalization;

 

string deliveryDate = DateTime.Now.ToString();

Context.Field("System Date").Text=deliveryDate;

Was this article helpful?

0 out of 0 found this helpful

Comments

3 comments

  • Avatar
    Vladimir Dimitrijević

    Hi,

    Actually too easy:

     

    using System;

    string deliveryDate = DateTime.Now.ToShortDateString();

    Context.Field("System Date").Text= deliveryDate;

     

    Best regards,

    Vladimir

    1
  • Avatar
    Permanently deleted user

    Thank you so much Vladimir.....Could you look the below link once please....??

    get the string in one line

    0
  • Avatar
    Permanently deleted user

    Vladimir - 

    How would you go about removing the forward slashes in the date?

    0

Please sign in to leave a comment.