/*
 * @(#)InaugurationDefault.java
 *
 * Summary: countdown to next US Presidential inauguration.
 *
 * Copyright: (c) 2000-2009 Roedy Green, Canadian Mind Products, http://mindprod.com
 *
 * Licence: This software may be copied and used freely for any purpose but military.
 *          http://mindprod.com/contact/nonmil.html
 *
 * Requires: JDK 1.1+
 *
 * Created with: IntelliJ IDEA IDE.
 *
 * Version History:
 *  1.2 2006-03-05 - reformat with IntelliJ, add Javadoc.
 *  1.3 2009-01-20 - change to Obama
 */
package com.mindprod.inauguration;

import java.text.DateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;

/**
 * countdown to next US Presidential inauguration.
 * <p/>
 * Demonstrates use of default date format for locale.
 * <p/>
 * @Version 2009-01-20 change to Obama
 *
 * @author Roedy Green, Canadian Mind Products
 * @version 1.3 2009-01-20 - change to Obama
 * @since 2000
 */
public final class InaugurationDefault
    {
    // ------------------------------ CONSTANTS ------------------------------

    /**
     * locale specific: e.g. Jan 20, 2005
     */
    private static final DateFormat DF = DateFormat.getDateInstance();

    // --------------------------- main() method ---------------------------

    /**
     * Main method.
     *
     * @param args not used
     */
    public static void main( String[] args )
        {
        // inauguration day is Thursday 2009-01-20 noon Eastern Standard
        // Time. Same code automatically adjusts for DST in the summer.
        final int inaugYear = 2013;
        TimeZone est = TimeZone.getTimeZone( "America/New_York" );
        GregorianCalendar inauguration = new GregorianCalendar( est );
        inauguration.set( inaugYear, Calendar.JANUARY, 21, 12, 0, 0 );

        // set timezone
        DF.setCalendar( inauguration );

        // set timestamp
        String dateString = DF.format( inauguration.getTime() );
        System.out.println( dateString );
        }
    }