C# Date format

Hi, Following code is working in the VS2015 but not working in the 2012

DateTime startDate
startDate.ToUniversalTime():s

Open in new window

This one is working in the 2012 startDate.ToUniversalTime() But after enter startDate.ToUniversalTime():s, getting error.
Any idea appricate.
LVL 2
lankapalaAsked:
Who is Participating?
 
zephyr_hex (Megan)Connect With a Mentor DeveloperCommented:
What is the error?  And what is the value of startDate ?  and what is ' :s ' ?

The problem is not going to be your version of Visual Studio, but the value of startDate, or what ' :s' is doing.

You'll see that this works fine:
		var startDate = DateTime.Now;
		var test = startDate.ToUniversalTime();
		Console.WriteLine(test);

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.