📄 httpgmttimestamp.java
字号:
// HTTPGMTTimestamp.java
package com.wrox.httpserver;
import java.text.*;
import java.util.*;
/**
* Encapsulates a GMT timestamp.
*/
class HTTPGMTTimestamp {
// Instance variable
private Date currentTime;
// Class variable
private static SimpleDateFormat formatter =
new SimpleDateFormat("d MMM yyyy hh:mm:ss 'GMT'", Locale.US);
/**
* Consructs the current GMT timestamp.
*/
public HTTPGMTTimestamp() {
currentTime = new Date();
}
/**
* Returns a formatted GMT timestamp.
*/
public String toString() {
return formatter.format(currentTime);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -