⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datetimeutils.java

📁 JBother是纯Java开发的Jabber(即时消息开源软件)客户端。支持群组聊天
💻 JAVA
字号:
package org.jivesoftware.smack.util;import java.util.Calendar;import java.util.TimeZone;import java.util.Date;import java.text.SimpleDateFormat;/** * User: luke * Date: 2004-12-30 * Time: 23:24:44 *//** * simple util class that should be able to handle date and time for jabber * based on JEP-0082 (Jabber Date adn Time Profiles) */public class DateTimeUtils {  // format used in JEP. The final 'Z' is for Zulu time  public static final String DATETIMEFORMAT = "yyyy-MM-dd'T'hh:mm:ss'Z'";  public static String getDateTime()  {    Calendar cal = Calendar.getInstance();    SimpleDateFormat dateTimeFormat = new SimpleDateFormat(DATETIMEFORMAT);    TimeZone timeZone = cal.getTimeZone();    return dateTimeFormat.format(new Date(cal.getTimeInMillis()        - timeZone.getOffset(cal.getTimeInMillis())));  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -