public class TimeUtil extends Object
Description: Time conversion utility class
| Constructor and Description |
|---|
TimeUtil() |
| Modifier and Type | Method and Description |
|---|---|
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 representation of date and time to Date on the server timezone
|
public Date convertFromTimeZone1StringToServerDate(SimpleDateFormat ndf, String tz1string, TimeZone tz1)
public String convertFromServerDateToTimeZone2String(SimpleDateFormat ndf, Date tz2Date, TimeZone tz1)
public Date getServerDateTime(SimpleDateFormat ndf, String clientString)
public String getDisplayDateTime(SimpleDateFormat ndf, Date serverDate)
Copyright © 2005-2014 Sakai Project. All Rights Reserved.