1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package com.vci.client.portal.form.defaultvalue;
 
import java.text.SimpleDateFormat;
 
import com.vci.client.ClientSession;
import com.vci.corba.common.VCIError;
 
 
/**
 * 
 * @Title        :DefaultValueInnerFunction.java
 * @Description    : 
 * @Copyright    :宏博远达科技有限公司
 * @Author        :平台与规划部/ZhongGY/E-mail:zhonggy@vci-tech.com
 * @Date        :2015-6-24
 * @Version        :1
 * @Other        :产生注释:Alt+Shift+J
 */
public class DefaultValueInnerFunction {
    
    private static DefaultValueInnerFunction instance = null;
    
    private DefaultValueInnerFunction(){}
    
    public synchronized static DefaultValueInnerFunction getInstance(){
        if (instance == null) {
            instance = new DefaultValueInnerFunction();
        }
        return instance;
    }
    
    /**
     * @Title        :获取系统当前时间(服务器端)
     * @Description    :
     * @return
     */
    public String getCurrentTime(){
        //return "TODO:getCurrentTime()";
        String format = "HH:mm:ss";
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        String dateString = "";
        try {
            dateString = sdf.format(ClientSession.getFrameworkService().getSystemTime());
        } catch (VCIError e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return dateString;
    }
    /**
     * @Title        :获取系统当前日期(服务器端)
     * @Description    :
     * @return
     */
    public String getCurrentDate(){
        //return "TODO:getCurrentDate()";
        String format = "yyyy-MM-dd";
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        String dateString = "";
        try {
            dateString = sdf.format(ClientSession.getFrameworkService().getSystemTime());
        } catch (VCIError e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return dateString;
    }
    /**
     * @Title        :获取系统当前日期(服务器端)
     * @Description    :
     * @return
     */
    public String getCurrentDateTime(){
        //return "TODO:getCurrentDateTime()";
        String format = "yyyy-MM-dd HH:mm:ss";
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        String dateString = "";
        try {
            dateString = sdf.format(ClientSession.getFrameworkService().getSystemTime());
        } catch (VCIError e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return dateString;
    }
}