Java Date Now getCurrentDateTime()

Here you can find the source of getCurrentDateTime()

Description

This method provide the current date and current time

License

Open Source License

Parameter

Parameter Description

Return

TimeStamp

Declaration


public static String getCurrentDateTime() throws ParseException 

Method Source Code

//package com.java2s;
/*/*from   w ww  .ja va  2  s.  com*/
 * @(#)ConversionUtils.java
 *
 * Copyright by ObjectFrontier, Inc.,
 * 12225 Broadleaf Lane, Alpharetta, GA 30005, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of ObjectFrontier, Inc. You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of
 * the license agreement you entered into with ObjectFrontier.
 */

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {
    protected static SimpleDateFormat userTimeFmt = new SimpleDateFormat("dd-MM-yyyy'-'HH:mm");

    /**
     * This method provide the current date and current time 
     * 
     * @param 
     * @return TimeStamp
     */

    public static String getCurrentDateTime() throws ParseException {
        java.util.Date today = new java.util.Date();
        String currentDateTime = userTimeFmt.format(today);
        return currentDateTime;
    }
}

Related

  1. getCurrentDateTime()
  2. getCurrentDateTime()
  3. getCurrentDateTime()
  4. getCurrentDateTime()
  5. getCurrentDateTime()
  6. getCurrentDateTime(String dateFormat)
  7. getCurrentDateTime(String format)
  8. getCurrentDateTimeForShow()
  9. getCurrentDateTimeISO8601()