DateTimeFormat - Long Representation

I am not sure where the syntax error is in this for the long representation of MonthName Day, YYYY.
I would also like to eliminate the day of the week prefix. Is there a built-in function?

str = DateTimeFormat( "%#x", dt ); // Long date representation, appropriate to current locale. For example: “Tuesday, March 14, 1995”.

There are many error messages available. You have to name it or show the line.
Also your code is incomplete. Your dt variable is unknown.

There is not an error with following code:

dt = SelectedValue(DateTime());
"Long date:";
str1 = DateTimeFormat( "%#x", dt );// long date
"Weekday removed:";
str2 = StrTrim(StrExtract(str1, 1)," ");// Remove weekday

Thank you, that helped me.

dt = SelectedValue(DateTime());
"Long date:";
str1 = DateTimeFormat( "%#x", dt );// long date
"Weekday removed:";
str2 = StrTrim(StrExtract(str1, 1)," ");// Remove weekday
str3 = DateTimeFormat( "%Y", dt ); // Add Year in Century format

Plot(Close,"Date: " + str2 + "," + str3 + "  Close:",colorwhite,styleline);


This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.