HOW to Format Date to String
HOW to Format Date to String
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").
e.Value=up_whrptquery.billdate==null?"":up_whrptquery.billdate.ToString("yyyy-MM-dd").
Re: HOW to Format Date to String
Hello.
Do you get any error? Please, send us a error message.
Why don't you use Text Format property?
Thank you.
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
Hello
because Text Format property don't have the format like this 2014-10-28.
Thank you.
because Text Format property don't have the format like this 2014-10-28.
Thank you.
Re: HOW to Format Date to String
Hello.
You could set any custom format string there.
In your case it will be next
Thank you.
You could set any custom format string there.
In your case it will be next
Code: Select all
yyyy-MM-dd
Re: HOW to Format Date to String
Thank you for your reply,it works well.
Re: HOW to Format Date to String
Hello.
You could use any Format String there.
Let us know if you need any additional help.
Thank you.
You could use any Format String there.
Let us know if you need any additional help.
Thank you.