Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
DateUtil.java
Package: cindyblog.rar [view]
Upload User: cdpainuo
Upload Date: 2022-07-12
Package Size: 5257k
Code Size: 1k
Category:
Jsp/Servlet
Development Platform:
Java
- package com.appspot.cindyblog.util;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- public class DateUtil {
- private static SimpleDateFormat NOW_TIME = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- private static SimpleDateFormat NOW_DATE = new SimpleDateFormat("yyyy-MM-dd");
- private static SimpleDateFormat STR_TIME = new SimpleDateFormat("yyyyMMddHHmmsssss");
- public static String getDate(){
- Date date = new Date();
- return NOW_DATE.format(toChila(date));
- }
- public static String getDate(Date date){
- return NOW_DATE.format(toChila(date));
- }
- public static String getTime(){
- Date date = new Date();
- return NOW_TIME.format(toChila(date));
- }
- public static String getTime(Date date){
- return NOW_TIME.format(toChila(date));
- }
- public static String getStrTime(){
- Date date = new Date();
- return STR_TIME.format(toChila(date));
- }
- public static String getStrTime(Date date){
- return STR_TIME.format(toChila(date));
- }
- private static Date toChila(Date date){
- date.setHours(date.getHours()+8);
- return date;
- }
- }