Date format 1.0

xiaoxiao2021-03-06  53

String a = "2004.09.25 12:34:23";

DateTime B = DATETIME.PARSE (A);

String y = B.Year.toString ();

String m = b.month.tostring ();

String r = b.day.tostring ();

IF (Y.LENGTH <2)

{

Y = "0" y;

}

IF (M.LENGTH <2)

{

M = "0" m;

}

String shu = y "." m "." r; //2004.09.25

String shu1 = b.toString ("YYYY.MM.DD"); //2004.34.25

String Shu2 = a.substring (0, 10); //2004.09.25

Response.write (SHU);

转载请注明原文地址:https://www.9cbs.com/read-112758.html

New Post(0)