techques
asked on
var strDate = '<%= System.DateTime.Now.ToString(\'yyyy-MM-dd\'); %>';
Hi
I write asp.net, c# and javascript
In the js, I need to get the system datetime and in the format yyyy-MM-dd
However, it has runtime error.
I write asp.net, c# and javascript
In the js, I need to get the system datetime and in the format yyyy-MM-dd
However, it has runtime error.
var strDate = '<%= System.DateTime.Now.ToString(\'yyyy-MM-dd\'); %>';
or
var strDate = '<%= System.DateTime.Now.ToString(\"yyyy-MM-dd\"); %>';
ASKER
It has compile error:
CS1026: ) expected
CS1026: ) expected
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>is that just for formatting?
yup, with some other features like doing validation and parsing for date string, etc. cheers
yup, with some other features like doing validation and parsing for date string, etc. cheers
ASKER
Thanks for all help. I add more points for all experts.
> Thanks for all help.
you're welcome, glad we could have been of some help.
However, as a long-time regular to EE I have to point you to the fact that it is best to just split the points and not except your own comment (which is not an answer) as answer. That way, people visiting this question get the correct answer and the PAQ archive of EE stays proper.
-- Abel --
you're welcome, glad we could have been of some help.
However, as a long-time regular to EE I have to point you to the fact that it is best to just split the points and not except your own comment (which is not an answer) as answer. That way, people visiting this question get the correct answer and the PAQ archive of EE stays proper.
-- Abel --
'<%= System.DateTime.Now.ToStri
I don't know why you put in the backslashes there, but you are not inside a string, so they are not necessary.