Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { /** * Get the current date and time formatted as expected by PBS' application. * @return */ public static String getCurrentTimeStamp() { SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss.SSS", Locale.US); Date now = new Date(); return sdf.format(now); } }