/*** Returns the current date and time string <br> * default format: yyyy-mm-dd hh: mm: SS ** @ return string returns the current string date and time */public static string getcurrenttime () {string returnstr = NULL; simpledateformat F = new simpledateformat ("yyyy-mm-dd hh: MM: SS "); Date = new date (); returnstr = f. format (date); Return returnstr;}/*** returns the current date and time string <br> * default format: yyyymmddhhmmss ** @ return string returns the current string date and time */public static bigdecimal getcurrenttimeasnum BER () {string returnstr = NULL; simpledateformat F = new simpledateformat ("yyyymmddhhmmss"); Date = new date (); returnstr = f. format (date); return New bigdecimal (returnstr );} /*** return the custom format of the current date and time string ** @ Param Format * format rule * @ return string returns the current string date and time */public static string getcurrenttime (string format) {string returnstr = NULL; simpledateformat F = new simpledateformat (format); Date = new DA Te (); returnstr = f. format (date); Return returnstr;}/*** returns the current string date ** @ return string returns the string date */public static string getcurdate () {calendar = calendar. getinstance (); simpledateformat = new simpledateformat ("yyyy-mm-dd"); string strdate = simpledateformat. format (calendar. gettime (); Return strdate;}/*** return the sorted date * @ Param formatstring * @ return */Public ST in the specified format Atic string date2string (date, string formatstring) {If (g4utils. isempty (date) {return NULL;} simpledateformat = new simpledateformat (formatstring); string strdate = simpledateformat. format (date); Return strdate ;} /*** return the current string date ** @ Param Format * format rule ** @ return string returned string date */public static string getcurdate (string format) {calendar = calendar. getinstance (); simp Ledateformat simpledateformat = new simpledateformat (format); string strdate = simpledateformat. format (calendar. gettime (); Return strdate;}/*** returns the timestamp object ** @ return */public static timestamp getcurrenttimestamp () {object OBJ = typecasehelper. convert (getcurrenttime (), "timestamp", "yyyy-mm-dd hh: mm: SS"); If (OBJ! = NULL) Return (timestamp) OBJ; elsereturn NULL ;} /*** convert string date to date ** @ Param strdate * string date * @ Param srcdateformat * Source date format * @ Param dstdateformat * target date format * @ return util. Returned by date. date */public static date stringtodate (string strdate, string srcdateformat, string dstdateformat) {date rtdate = NULL; Date tmpdate = (New simpledateformat (srcdateformat )). parse (strdate, new parseposition (0); string t Mpstring = NULL; If (tmpdate! = NULL) tmpstring = (New simpledateformat (dstdateformat). Format (tmpdate); If (tmpstring! = NULL) rtdate = (New simpledateformat (dstdateformat). parse (tmpstring, new parseposition (0); Return rtdate ;}