Here you can find the source of getServerToUserDateString(TimeZone timeZone, int dateFormat, java.sql.Timestamp date)
Parameter | Description |
---|---|
timeZone | Description of the Parameter |
dateFormat | Description of the Parameter |
date | Description of the Parameter |
public static String getServerToUserDateString(TimeZone timeZone, int dateFormat, java.sql.Timestamp date)
//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); } }