I have a function that must work the same way on both client and server and it formats dates.
if (GWT.isClient()) { // Use DateTimeFormat } else { // Use
import com.google.gwt.i18n.shared.DateTimeFormat; DateTimeFormat fm = DateTimeFormat.getFormat("MM/dd"); String st = fm.format(date);