Skip to content

Instantly share code, notes, and snippets.

Created November 13, 2012 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4069180 to your computer and use it in GitHub Desktop.
Save anonymous/4069180 to your computer and use it in GitHub Desktop.
vargs to vargs
import java.io.PrintStream;
import java.text.SimpleDateFormat;
public class runMe {
public static void main(String[] args) {
my_printf("Hello %s\n", "Dave");
}
private static PrintStream my_printf(String fmt, Object... args) {
SimpleDateFormat df = new SimpleDateFormat("(yyyy-MM-dd HH:mm:ss)");
java.util.Date now = new java.util.Date();
return System.out.printf( "%s "+fmt, df.format(now), args );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment