Package com.cdc; import java.util. *; import java.io. *; / ** * Common base function (including merging arrays, split strings to array, generating random numbers, replacing sub-strings in the string Get the current time), transfer the HashTable content into an array * Create Date: (2001-7-19 17:22:33) * @Author: Liu Xiaodong * / public class util {/ ** * Patching array. * Creation date: (2001-8-13 17:08:26) * @Return java.lang.string * @Param param java.lang.string * / public string join_Array (String [] param, string spilt) {String Rentunstring StringBuffer Tempstr = new stringbuffer (); int LEN = param.length; for (int i = 0; i * / Public String replaceString (String param, String param1, String param2) throws java.lang.Exception {String returnString = ""; try {if (param = null && param1 = null && param2 = null && param!!!!. Equalsignorecase ("") &&! param1.equalsignorecase ("") &&! param2.equalsignorecase (")) {int = param.length (); // Original string length int int int1Src = param1.length (); / / Need to replace the sub-string length INT INT INTPOINT = 0; // Current location while (intPoint * / Public Hashtable spilt (String fieldsru, String tag) {Hashtable returnarray = new Hashtable (); char dot = tag.charAt (0); String field; field = fieldsru dot; int num = 0; int field_len = field. Length (); for (int i = 0; i * / public string [] spilt_str (string fieldsru, string tag) {// hashtable retrainArray = new hashtable (); char dot = tag.charat (0); string field; field = fieldsru Dot; int Num = 0; int Field_len = Field.Length (); for (int i = 0; i * / public string [] splitstring (string fieldsru, string tag) {TRY {int dot_len = tag.Length (); // Get the length of the splitter INT STR_LEN = FieldSru.length (); // String length string tempstr = FieldSRU TAG; int Num = 0; for (int i = 0; I * / Public String gettime (int time_zone) throws java.lang.Exception {String nowtime = ""; try {if (time_zone> 0) {time_zone = time_zone - 1;} else if (time_zone <0) {time_zone = time_zone 1;} String [] IDS = Timezone.GetavailaableIDS (Time_Zone * 60 * 60 * 1000); SimpleTimezone PDT = New SimpleTimezone (Time_Zone * 60 * 60 * 1000, IDS [0]); Pdt.SetStartRule (Calendar.april, 1 , Calendar.Sunday, 2 * 60 * 60 * 1000); pdt.SetendRule (Calendar.October, -1, Calendar.Sunday, 2 * 60 * 60 * 1000); Calendar Calendar = New Gregoriancalendar (PDT); Date TrialTime = New Date (); Calendar.SetTime (TRIALTIME); String Now_Year = New Integer (Calendar.Get (Calendar.year)). TOSTRING (); string now_month = new integer (Calendar.Get (Calendar.Mont) 1). Tostring (); if (now_month.length () == 1) {now_MOWTH = "0" now_month;} string now_date = new integer (Calendar.get (Calendar.date)). TOSTRING (); if (now_date.length () == 1) {now_date = "0" now_date;} int AM_PM = Calendar.get (Calendar.Am_PM); String Now_hou R = new integer (Calendar. Hour). TOSTRING (); if (am_pm == 1) {INT INTNOW_HOUR = INTEGER.PARSEINT (now_HOUR) 12; now_Hour = (new integer (intnow_Hour). Tostring ();} else {} == 1) {now_HOUR = "0" now_hour;} String now_minute = new integer (Calendar.Get (Calendar.minute)). Tostring (); IF Now_minute.Length () == 1) {now_minute = "0" now_minute;} string now_second = new integer (Calendar.Get (Calendar.Second)). Tostring (); if (now_second.length () == 1) {now_second = "0" now_second;