Some methods of use of DateTime

xiaoxiao2021-03-05  23

1, DateTime digital system.datetime currenttime = new system.datetime (); 1.1 Net ago, the month-time time, the second currenttime = system.datetime.now; 1.2 Before the year INT year = currenttime.year; 1.3 take the prior month INT month = CURRENTTIME.MONTH; 1.4 Take Front Day INT Day = CURRENTTIME.DAY; 1.5 Take the current INT = CURRENTTIME.HOUR; 1.6 Take the Prior INT = CURRENTTIME.MINUTE; 1.7 Take the second second = CurrentTime.second; 1.8 Take the current millisecond INT millisecond = currenttime.millisecond; (Variable available Chinese) 1.9 Take Chinese Date Display - String StRING STRING STRING Stry = CURRENTTIME.TOSTRING ("f"); // Do not show second 1.10 Take Chinese Date display _ year String strym = currenttime.tostring ("y"); 1.11 Take Chinese date display _ month string strmd = currenttime.tostring ("m"); 1.12 Take Chinese Year String Strymd = CurrentTime.toString ("D") 1.13 Take the current time, format: 14: 24 string strat = currenttime.tostring ("t"); 1.14 Take the current time, format is: 2003-09-23T14: 46: 48 string strat = currenttime.tostring ("s" "); 1.15 Take the current time, format is: 2003-09-23 14: 48: 30Z string strat = currenttime.tostring (" u "); 1.16 Take the current time, format is: 2003-09-23 14:48 String Strt = CURRENTTIME.TOSTRING ("g"); 1.17 Take the current time, format: Tue, 23 Sep 2003 14:52:40 gmt string strat = currenttime.tostring ("r"); 1.18 Get date after N days later Time datetime newday = d ATETIME.NOW.ADDAYS (100);

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

New Post(0)