org.sakaiproject.tool.assessment.ui.listener.util
Class TimeUtil

java.lang.Object
  extended by org.sakaiproject.tool.assessment.ui.listener.util.TimeUtil

public class TimeUtil
extends Object

Description: Time conversion utility class


Constructor Summary
TimeUtil()
           
 
Method Summary
 String convertFromServerDateToTimeZone2String(SimpleDateFormat ndf, Date tz2Date, TimeZone tz1)
          Convert a Date reprepsentation of date and time in the server TimeZone to String representation of date and time in client TimeZone used for display.
 Date convertFromTimeZone1StringToServerDate(SimpleDateFormat ndf, String tz1string, TimeZone tz1)
          Convert a String reprepsentation of date and time in the client TimeZone to Date representation of date and time in server TimeZone before saving to DB.
 String getDisplayDateTime(SimpleDateFormat ndf, Date serverDate)
          Convert a Date reprepsentation of date and time to String in the client timezone for display
 Date getServerDateTime(SimpleDateFormat ndf, String clientString)
          Convert a String reprepsentation of date and time to Date on the server timezone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeUtil

public TimeUtil()
Method Detail

convertFromTimeZone1StringToServerDate

public Date convertFromTimeZone1StringToServerDate(SimpleDateFormat ndf,
                                                   String tz1string,
                                                   TimeZone tz1)
Convert a String reprepsentation of date and time in the client TimeZone to Date representation of date and time in server TimeZone before saving to DB. tz1 is the client timezone, tz2 is the server timezone


convertFromServerDateToTimeZone2String

public String convertFromServerDateToTimeZone2String(SimpleDateFormat ndf,
                                                     Date tz2Date,
                                                     TimeZone tz1)
Convert a Date reprepsentation of date and time in the server TimeZone to String representation of date and time in client TimeZone used for display. tz1 is the client timezone, tz2 is the server timezone


getServerDateTime

public Date getServerDateTime(SimpleDateFormat ndf,
                              String clientString)
Convert a String reprepsentation of date and time to Date on the server timezone


getDisplayDateTime

public String getDisplayDateTime(SimpleDateFormat ndf,
                                 Date serverDate)
Convert a Date reprepsentation of date and time to String in the client timezone for display



Copyright © 2005-2012 Sakai Project. All Rights Reserved.