Page 1 of 1

HOW to Format Date to String

Posted: Mon Oct 27, 2014 3:46 am
by Andy1120
I had this problem about format date to string many days ago. I use the function Year,Month,Day to format that give me some trouble.Today I find can write expression in the getvalue attribute.the Code like below.
e.Value=up_whrptquery.billdate==null?"":up_whrptquery.billdate.ToString("yyyy-MM-dd").

Re: HOW to Format Date to String

Posted: Mon Oct 27, 2014 8:40 am
by HighAley
Hello.

Do you get any error? Please, send us a error message.
Why don't you use Text Format property?

Thank you.

Re: HOW to Format Date to String

Posted: Tue Oct 28, 2014 7:07 am
by Andy1120
Hello
because Text Format property don't have the format like this 2014-10-28.
Thank you.

Re: HOW to Format Date to String

Posted: Tue Oct 28, 2014 7:21 am
by HighAley
Hello.

You could set any custom format string there.
In your case it will be next

Code: Select all

yyyy-MM-dd
Thank you.

Re: HOW to Format Date to String

Posted: Wed Oct 29, 2014 2:03 am
by Andy1120
Thank you for your reply,it works well.

Re: HOW to Format Date to String

Posted: Wed Oct 29, 2014 7:46 am
by HighAley
Hello.

You could use any Format String there.
Let us know if you need any additional help.

Thank you.