Here you can find the source of toEnglishHours(java.sql.Timestamp ts)
Parameter | Description |
---|---|
ts | - Timestamp |
public static String toEnglishHours(java.sql.Timestamp ts)
//package com.java2s; public class Main { /**/*from www . j a v a 2 s.co m*/ * given timestamp object and return string format of hh * <p/> * <p/> * * @param ts - Timestamp * @return String * author Vincent Yuen * version %I%, %G% */ public static String toEnglishHours(java.sql.Timestamp ts) { String hours = ""; if (ts != null) { hours = ts.toString(); int index = hours.indexOf(":"); hours = hours.substring(index - 2, index); } return hours; } }