package com.mindprod.example;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import static java.lang.System.*;
/**
* Display Today's date in Zulu format.
*
* @author Roedy Green, Canadian Mind Products
* @version 1.0 2008-06-21
* @since 2008-06-21
*/
public final class TestZulu
{
/**
* Zulu format mask 2008-06-22T14:51:18.62Z
*/
private static final SimpleDateFormat SDF =
new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" );
/**
* Display current Zulu/UTC military time,
* e.g. 2008-06-22T14:51:18.62Z
*
* @param args not used
*/
public static void main( String[] args )
{
final TimeZone utc = TimeZone.getTimeZone( "UTC" );
SDF.setTimeZone( utc );
final String milliformat = SDF.format( new Date() );
final String zulu = milliformat.substring( 0, 22 ) + 'Z';
out.println( zulu );
}
}