eu.emi.emir.client.util
Class DateUtil

java.lang.Object
  extended by eu.emi.emir.client.util.DateUtil

public class DateUtil
extends Object

Author:
a.memon, g.szigeti

Field Summary
static SimpleDateFormat ISODateFormat
           
static SimpleDateFormat ServiceDateFormat
           
static SimpleDateFormat UTCISODateFormat
           
 
Constructor Summary
DateUtil()
           
 
Method Summary
static org.codehaus.jettison.json.JSONObject addDate(org.codehaus.jettison.json.JSONObject jo, String attrName, Date d)
           
static Date addDays(Date date, Integer days)
          Add days to the given date
static Date addDays(Integer days)
          Add days to the current date
static Date addHours(Date date, Integer hours)
          Add hours to the given date
static Date addHours(Integer hours)
          Add hours to the current date
static Date fromXmlGregorian(XMLGregorianCalendar xmlCal)
           
static Date getDate(org.codehaus.jettison.json.JSONObject json)
           
static org.codehaus.jettison.json.JSONObject setCreationTime(org.codehaus.jettison.json.JSONObject jo, Integer days)
           
static org.codehaus.jettison.json.JSONObject setExpiryTime(org.codehaus.jettison.json.JSONObject jo, Integer days)
           
static org.codehaus.jettison.json.JSONObject setExpiryTimeWithHours(org.codehaus.jettison.json.JSONObject jo, Integer hours)
           
static String toUTCFormat(Date d)
           
static Date toUTCFormat(String d)
           
static XMLGregorianCalendar toXmlGregorian(Date d)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ServiceDateFormat

public static SimpleDateFormat ServiceDateFormat

ISODateFormat

public static SimpleDateFormat ISODateFormat

UTCISODateFormat

public static SimpleDateFormat UTCISODateFormat
Constructor Detail

DateUtil

public DateUtil()
Method Detail

setCreationTime

public static org.codehaus.jettison.json.JSONObject setCreationTime(org.codehaus.jettison.json.JSONObject jo,
                                                                    Integer days)

setExpiryTime

public static org.codehaus.jettison.json.JSONObject setExpiryTime(org.codehaus.jettison.json.JSONObject jo,
                                                                  Integer days)

setExpiryTimeWithHours

public static org.codehaus.jettison.json.JSONObject setExpiryTimeWithHours(org.codehaus.jettison.json.JSONObject jo,
                                                                           Integer hours)

addDate

public static org.codehaus.jettison.json.JSONObject addDate(org.codehaus.jettison.json.JSONObject jo,
                                                            String attrName,
                                                            Date d)

addDays

public static Date addDays(Date date,
                           Integer days)
Add days to the given date


addDays

public static Date addDays(Integer days)
Add days to the current date


addHours

public static Date addHours(Date date,
                            Integer hours)
Add hours to the given date


addHours

public static Date addHours(Integer hours)
Add hours to the current date


getDate

public static Date getDate(org.codehaus.jettison.json.JSONObject json)
                    throws JSONToGlue2MappingException
Parameters:
resJson -
Throws:
JSONToGlue2MappingException

toUTCFormat

public static String toUTCFormat(Date d)

toUTCFormat

public static Date toUTCFormat(String d)
                        throws ParseException
Throws:
ParseException

toXmlGregorian

public static XMLGregorianCalendar toXmlGregorian(Date d)
                                           throws DatatypeConfigurationException
Throws:
DatatypeConfigurationException

fromXmlGregorian

public static Date fromXmlGregorian(XMLGregorianCalendar xmlCal)
                             throws DatatypeConfigurationException
Throws:
DatatypeConfigurationException


Copyright © 2012 EMI. All Rights Reserved.