Utility.java
Utility.java · 448 B
From the archive Chatter.zip
Download the archive « Back to the archive contents
import java.text.*;
import java.util.*;
class Utility
{
static Date date;
static DecimalFormat dateFormat = new DecimalFormat("00");
static int hours;
public static String getTimestamp()
{
date = new Date();
hours = date.getHours();
if(hours > 12)
hours -= 12;
return (dateFormat.format(hours) + ":" + dateFormat.format(date.getMinutes()) + ":" + dateFormat.format(date.getSeconds()) + "> ");
}
}