Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Table of Contents |
---|
Code Block | ||
---|---|---|
| ||
import java.util.Date;
import org.joget.commons.util.TimeZoneUtil;
import org.joget.apps.app.service.AppUtil;
//Format current date to System/User selected timezone and date format
String dateString = TimeZoneUtil.convertToTimeZone(new Date(), null, AppUtil.getAppDateFormat()); |
public static java.lang.String convertToTimeZone(java.lang.Date time, java.lang.String gmt, java.lang.String format)
Convert Date to String based on GMT/Timezone ID and Date Format.
Parameters:
gmt - GMT ("-12" to "12") or Timezone ID, NULL to use System/User selected timezone.
format - follow java.text.SimpleDateFormat syntax.
public static java.util.Map<java.lang.String, java.lang.String> getList()
Retrieve a list of Time Zone.
Return a map of time zone id and its description
public static java.lang.String getServerTimeZone()
Retrieve Server Time Zone in GMT format
public static java.lang.String getServerTimeZoneID()
Retrieve Server Time Zone ID
public static java.lang.String getTimeZoneByGMT(java.lang.String gmt)
Get Time Zone ID by GMT