Java Timestamp Create createTimestamp()

Here you can find the source of createTimestamp()

Description

Returns current timestamp as xs:Date format.

License

Open Source License

Declaration

static public String createTimestamp() 

Method Source Code

//package com.java2s;
/**// ww  w  .j  a  v  a  2  s.  c  o m
 * Created by IntelliJ IDEA.
 * User: Piek Vossen
 * Date: 17-dec-2008
 * Time: 14:38:37
 * To change this template use File | Settings | File Templates.
 * This file is part of KafSaxParser.
    
KafSaxParser is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
    
KafSaxParser is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
    
You should have received a copy of the GNU General Public License
along with KafSaxParser.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /** Returns current timestamp as xs:Date format. */
    static public String createTimestamp() {
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
        String formattedDate = sdf.format(date);
        return formattedDate;
    }
}

Related

  1. createEtag(String cookieId, Date timestamp)
  2. createTimeStamp()
  3. createTimeStamp()
  4. createTimeStamp()
  5. createTimestamp(final int aYear, final int aMonth, final int aDate, final int aHour, final int aMinute, final int aSecond)