⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exchangeinput.java

📁 spring+struts+hibernate做的银行系统
💻 JAVA
字号:
//Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
//Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
//Decompiler options: packimports(3) fieldsfirst ansi 
//Source File Name:   exchangeInput.java

package cn.com.tym.util.text;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ExchangeInput
{

 public ExchangeInput()
 {
 }

 public static String StringToString(String input)
 {
     if(input == null)
         input = "";
     else
         input = input.trim();
     return input;
 }

 public static int StringToInt(String input)
 {
     int output = 0;
     if(input != null)
     {
         input = input.trim();
         try
         {
             output = Integer.parseInt(input);
         }
         catch(Exception ex) { }
     }
     return output;
 }

 public static float StringToFloat(String input)
 {
     float output = 0.0F;
     if(input != null)
     {
         input = input.trim();
         try
         {
             output = Float.parseFloat(input);
         }
         catch(Exception ex) { }
     }
     return output;
 }

 public static Date exchangeLongToDate(long input)
 {
     Date date = new Date(input);
     return date;
 }

 public static String exchangeLongToTimeString(long input, int mark)
 {
     String output = "";
     String timeText[][] = {
         {
             "��", "��", "Сʱ"
         }, {
             "Seconds", "Minutes", "Hours"
         }
     };
     int hour = 0;
     int minute = 0;
     int second = 0;
     hour = (int)input / 0x36ee80;
     minute = ((int)input - hour * 0x36ee80) / 60000;
     second = ((int)input - hour * 0x36ee80 - minute * 60000) / 1000;
     if(hour == 0)
     {
         if(minute == 0)
             output = second + timeText[mark][0];
         else
             output = minute + timeText[mark][1] + second + timeText[mark][0];
     } else
     {
         output = hour + timeText[mark][2] + minute + timeText[mark][1] + second + timeText[mark][0];
     }
     timeText = null;
     return output;
 }

 public static String exchangeLongToDateString(long input, String mark)
 {
     Date date = new Date(input);
     String output = "";
     SimpleDateFormat formatter = new SimpleDateFormat(mark);
     output = formatter.format(date);
     return output;
 }
 
 
 public static String getNewTime()
 {
	 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	Date date=new Date();
		String strDate = sf.format(date);
 	return strDate;
 }
 public static String getNewTimefour()
 {
	 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
	Date date=new Date();
		String strDate = sf.format(date);
 	return strDate;
 }
 
 public static String getTime(String time)
 {
	 String times=time.substring(0,9);
	 times=times.replace('-','/');
		 
 	return times;
 }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -