Java Date Format dateFormatUTC()

Here you can find the source of dateFormatUTC()

Description

date Format UTC

License

Educational Community License

Declaration

private static DateFormat dateFormatUTC() 

Method Source Code

//package com.java2s;
/**//from   w  ww .  j a  va2  s . c o m
 *  Copyright 2009, 2010 The Regents of the University of California
 *  Licensed under the Educational Community License, Version 2.0
 *  (the "License"); you may not use this file except in compliance
 *  with the License. You may obtain a copy of the License at
 *
 *  http://www.osedu.org/licenses/ECL-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an "AS IS"
 *  BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 *  or implied. See the License for the specific language governing
 *  permissions and limitations under the License.
 *
 */

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.TimeZone;

public class Main {
    private static DateFormat dateFormatUTC() {
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
        df.setTimeZone(TimeZone.getTimeZone("UTC"));
        return df;
    }
}

Related

  1. dateFormatted(Date date)
  2. dateFormatter(String dateFormat)
  3. dateFormatTime(final Date date)
  4. dateFormatToString(Date date, String format)
  5. dateFormatToString(String source, String format)
  6. dateTime2Str(Date date, String pattern)
  7. dateTime2String(Date value)
  8. dateTime2StringFs(Date date)
  9. dateTimeFormat(Date dateTime)