Java Hour Format formatAsCassandraDateTime(Date date)

Here you can find the source of formatAsCassandraDateTime(Date date)

Description

Formats as a date time string till mins

License

Open Source License

Parameter

Parameter Description
date a parameter

Declaration

public static String formatAsCassandraDateTime(Date date) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final String ISO8601_DATETIME_ZONE = "yyyy-MM-dd HH:mm:ssZ";

    /**/* ww  w .  j av a  2 s .c  o m*/
     * Formats as a date time string till mins
     * @param date
     * @return
     */
    public static String formatAsCassandraDateTime(Date date) {
        SimpleDateFormat parser = new SimpleDateFormat();
        parser.setLenient(false);
        parser.applyPattern(ISO8601_DATETIME_ZONE);
        return parser.format(date);
    }
}

Related

  1. format2NormalTime(Date date)
  2. format_default(Date time)
  3. formatAbsoluteTime(long time)
  4. formatAddTime(Date addTime)
  5. formatAllDate(Date date)
  6. formatAsDateAndTime(Date date)
  7. formatAsHour(long l)
  8. formatAsRoundTripDate(Date date)
  9. formatAsXsdDateTime(Date date)