|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.ads.dfp.axis.utils.v201201.DateTimes
public final class DateTimes
A utility class for handling DateTime objects.
| Field Summary | |
|---|---|
static String |
DATE_TIME_FORMAT
|
| Method Summary | |
|---|---|
static DateTime |
fromDate(Date date)
Creates a DateTime object from a Java Date object already
set to the publisher's timezone. |
static DateTime |
fromString(String dateTimeString)
Creates a DateTime object from a string representation in the form
of yyyy-MM-ddTHH:mm:ss (e.g. |
static DateTime |
now(String timeZoneId)
Gets a DateTime object representing the present time in the
timezone of the publisher. |
static Date |
toDate(DateTime dateTime)
Gets a Java Date object from a DateTime object. |
static DateTime |
today(String timeZoneId)
Gets a DateTime object representing midnight of the present date in
the timezone of the publisher (i.e. |
static String |
toString(DateTime dateTime)
Gets a string representation of the DateTime object in the form
of yyyy-mm-ddTHH:mm:ss (e.g. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DATE_TIME_FORMAT
| Method Detail |
|---|
public static DateTime fromString(String dateTimeString)
throws ParseException
DateTime object from a string representation in the form
of yyyy-MM-ddTHH:mm:ss (e.g. 2011-01-01T00:00:00).
dateTimeString - the string representation of the DateTime
DateTime object created from the string
ParseException - if the string could not be parsedpublic static DateTime fromDate(Date date)
DateTime object from a Java Date object already
set to the publisher's timezone. The timezone will not be set on the
DateTime object as it is ignored as input for all use cases.
date - the Date object to transform into a DateTime
DateTime representing datepublic static DateTime now(String timeZoneId)
DateTime object representing the present time in the
timezone of the publisher.
timeZoneId - the timezone of the publisher
DateTime object representing the present time in the
publisher's timezonepublic static DateTime today(String timeZoneId)
DateTime object representing midnight of the present date in
the timezone of the publisher (i.e. all time fields are nullified).
timeZoneId - the timezone of the publisher
DateTime object representing the present date in the
publisher's timezonepublic static Date toDate(DateTime dateTime)
Date object from a DateTime object. The
timezone of the DateTime object is used when creating the new
date object.
dateTime - the DateTime object to convert to a Date
DateTime object as a Date in the timezone set
within dateTimepublic static String toString(DateTime dateTime)
DateTime object in the form
of yyyy-mm-ddTHH:mm:ss (e.g. 2011-01-01T000:00:00)
dateTime - the DateTime object used to create the string
DateTime object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||