Home > Net >  C #, from system. A datetime to int
C #, from system. A datetime to int

Time:09-30

How should change

CodePudding user response:


Please according to the structure of the DateTime function pass to participate!

CodePudding user response:

It is better to translate all kinds of basic types, and understand the first,

CodePudding user response:

You are A, B, C should ToInt,

CodePudding user response:

 
String [] Weekdays={" Monday ", "Tuesday", "on Wednesday", "Thursday", "Friday", "Saturday", "week 鈤"};
DateTime now=DateTime. Now;
Console. WriteLine (" {0: yyyy years now on d M, H point M}, {1} ", now, Weekdays [(int) now. DayOfWeek]);
String A, B, C;
Console. WriteLine (" please enter the start time (date) (month) (year) : ");
A=Console. ReadLine ();
B=Console. ReadLine ();
C=Console. ReadLine ();

DateTime start=new DateTime (Convert ToInt16 (A), Convert the ToInt16 (B), Convert the ToInt16 (C));
TimeSpan times=now - start;
From the Console. WriteLine (" {0} on {1} {2} to {3} days have passed now ", A, B, C, times);
The Console. ReadLine ();

CodePudding user response:

Somebody else method definitions need you to type int value, ABC is a datetime types, you define the system give you hint to a datetime to int

CodePudding user response:

The constructor need to pass the wrong parameter types

CodePudding user response:

refer to the second floor exception92 response:
it is better to translate all kinds of basic types, and understand the first,

When having a class without saying hh I don't know much about it, and also don't know how to check

CodePudding user response:

You can read the newspaper in the wrong prompt

CodePudding user response:

The convert. Toint32 (),

CodePudding user response:

Didn't you so use timespan,
Friend, your problem is serious, call a method parameter types in;
You will not now how to solve the problem, is to know how to read the newspaper in the wrong information
  •  Tags:  
  • C#