Java Timestamp Field getServerToUserDateString(TimeZone timeZone, int dateFormat, java.sql.Timestamp date)

Here you can find the source of getServerToUserDateString(TimeZone timeZone, int dateFormat, java.sql.Timestamp date)

Description

Gets the serverToUserDateString attribute of the DateUtils class

License

Open Source License

Parameter

Parameter Description
timeZone Description of the Parameter
dateFormat Description of the Parameter
date Description of the Parameter

Return

The serverToUserDateString value

Declaration

public static String getServerToUserDateString(TimeZone timeZone, int dateFormat, java.sql.Timestamp date) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.TimeZone;

public class Main {
    /**//from  w w w.  j a va2s  .  com
     *  Gets the serverToUserDateString attribute of the DateUtils class
     *
     * @param  timeZone    Description of the Parameter
     * @param  dateFormat  Description of the Parameter
     * @param  date        Description of the Parameter
     * @return             The serverToUserDateString value
     */
    public static String getServerToUserDateString(TimeZone timeZone, int dateFormat, java.sql.Timestamp date) {
        SimpleDateFormat formatter = null;
        try {
            // Used by the Calendar for storing events in an array
            formatter = (SimpleDateFormat) SimpleDateFormat.getDateInstance(dateFormat);
            formatter.applyPattern("M/d/yyyy");
            formatter.setTimeZone(timeZone);
        } catch (Exception e) {
            System.err.println("EXCEPTION: DateUtils -> Timestamp " + date);
        }
        return formatter.format((java.util.Date) date);
    }
}

Related

  1. getRandTimestamp(Random r)
  2. getRealCalendar(Timestamp time)
  3. getResultRowValueAsTimestamp(String valueName, Map resultRow)
  4. getSafeLong(final Timestamp d, final long i)
  5. getSeconds(Timestamp timeStamp)
  6. getSqlTimeStamp()
  7. getSqlTimeStamp(java.util.Date date)
  8. getSQLTimeStampForDate(Date date)
  9. getSqlTimestampFromMicrosSinceEpoch( long timestamp)