HI All,
I have searched for an answer for this and although ti is really basic can find no pointers, except a solution for PHP.
I am using ASPRunner.Net, hence C#, and creating a custom field in the 'view as' option on a form.
But I am struggling to convert the ["dob"] (which is a datetime field on the database) into a custom text format:
This
value = data["firstname"].ToString() + " " + data["lastname"].ToString() + " " + value = data["dob"].ToString("dd-mm-yyyy");
...should work according to c# resources, but throws a compilation error of 'include\CustomExpressions.cs(34,90): error CS1501: No overload for method 'ToString' takes 1 arguments'
This is a PHP solution, but neither date nor strtotime are available under c#; the alternative to strtotime given is ToString("dd-mm-yyyy");
$value = date('D/d/M/Y', strtotime($value)
I do find dates quite challenging - there never seems an easy solution to achieve what one wants!
What am a I doing wrong?
Many thanks!
DAvid