I want to get System date in one of the field

  • 503 Views
  • Last Post 13 February 2020
  • Topic Is Solved
Sunil Edupuganti posted this 30 November 2017

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;

Order By: Standard | Newest | Votes
Vladimir Dimitrijevic posted this 30 November 2017

Hi,

Actually too easy:

 

using System;

string deliveryDate = DateTime.Now.ToShortDateString();

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

 

Best regards,

Vladimir

  • Liked by
  • zroy21
Sunil Edupuganti posted this 30 November 2017

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

get the string in one line

zroy21 posted this 13 February 2020

Vladimir - 

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

Close