package com.trs.example; import junit.framework.TestCase; import com.trs.TRSWCMBaseTest; import com.trs.infra.util.CMyDateTime; public class CMyDateTimeExample extends TestCase { public void createNewDate()throws Exception{ // 1 构造新的时间 CMyDateTime dtValue = new CMyDateTime(); dtValue.setDateTimeWithString("2011-02-28 12:30"); // 2 输出格式化的时间 System.out.println(dtValue.toString("yyyy年MM月dd日")); // 3 获取当前时间 CMyDateTime dtNow = CMyDateTime.now(); } }