Skip to content

Instantly share code, notes, and snippets.

@bradleybeddoes
Forked from anonymous/runMe
Created November 13, 2012 23:39
Show Gist options
  • Save bradleybeddoes/4069181 to your computer and use it in GitHub Desktop.
Save bradleybeddoes/4069181 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( df.format(now).toString()+fmt, args );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment