Java Timestamp Convert To convertTimestampToStringWithoutTime(final Timestamp ts)

Here you can find the source of convertTimestampToStringWithoutTime(final Timestamp ts)

Description

convert Timestamp To String Without Time

License

Open Source License

Declaration

public static String convertTimestampToStringWithoutTime(final Timestamp ts) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.sql.Timestamp;

import java.util.Calendar;

public class Main {
    public static String convertTimestampToStringWithoutTime(final Timestamp ts) {
        final Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(ts.getTime());
        return cal.get(Calendar.YEAR) + "-" + cal.get(Calendar.MONTH) + "-" + cal.get(Calendar.DAY_OF_MONTH);
    }//from  w  w  w. ja v  a2  s  .  c o m
}

Related

  1. convertTimestamp(Timestamp timestamp)
  2. convertTimestampToDate(Timestamp timestamp)
  3. convertTimestampToDDMMMMYYYY(Timestamp dateTime)
  4. convertTimestampToString(Timestamp dateTime, String dateFormat)
  5. convertTimestampToString(Timestamp str)
  6. convertToDate(Timestamp aTimeStamp)
  7. convertToDate(Timestamp timestamp)
  8. convertToEpochMillis(java.sql.Timestamp ts)
  9. convertToISO8601String(java.sql.Timestamp ts)