C # in the same as JS in the basic;
Datetime Da=datetime.now; --Get the current time
DateTime da=new datetime (2000,10,10)--Create a new time
Da,tostring ("yyyy MM DD Day")--Set date format yyyy-mm-month dd-Day hh-12 system hour HH-24 system hour mm-minutes ss-seconds ms-milliseconds
Str.toupper && Str.tolower--casing conversion. Unlike JS, there is no case at the back.
Str.trim (); Str.trimstart (); Str.trimend (); --Remove the space, go to the front space, go after the space
Str.contains ("a")--judging whether it is contained, type Boolean, bool
Str. Startwidth ("a") str. Endswidth ("a")--judging with what the beginning end usage is the same as contains
Str.replace ("A", "B")--replace the string in the
Math.pow (x, y)--data type double type
------------------------------------------------------------
DateTime TT = new DateTime (2000, 10, 10);
DateTime t = DateTime.Now;
TimeSpan m =tt-t;
int b = m.days;
The use of timespan, the difference in how many days
-----------------------------------------------------------
. AddYears (); -How many years are added on this time basis
. AddMonths (); -Increase Month
. AddDays (); -Increase Day
. AddHours (); -Increase hours
. AddMinutes (); -Add minutes
. AddSeconds (); -Add seconds
. year; -Gets the year of this time variable
. Month; -Get Month
. Day; -Day
. Hour; -Hour
. Minute; -Minute
. Second; -Seconds
. millisecond; -Milliseconds
. DayOfYear; -Gets the current date is the day ordinal of the year
. DayOfWeek; -Get the day of the week
. TimeOfDay; -Get Time section
. Date; -Get Date part
TimeSpan type-time interval type
. Days-the difference in how many day
. Hours-How many hours the gap is in a day
. Minutes-How many minutes the gap in a day
. Seconds-How many seconds difference in a day
. Milliseconds-MS
. Total .... Cumulative gap
C # String, time, math type