public static class DB.DateTime extends DB implements Comparable<DB.DateTime>
DB.BigInt, DB.Bit, DB.DateTime, DB.Int, DB.NullObject, DB.Real, DB.Str
Modifier and Type | Field and Description |
---|---|
static SimpleDateFormat |
DAY_FORMAT |
static SimpleDateFormat |
DAY_N_TIME_FORMAT |
Constructor and Description |
---|
DateTime()
Default Construction (creates a null object)
|
DateTime(Date value)
Create and set value from a java.util.Date instance
|
DateTime(Object value)
Create and set value from an Object
If Object is | Value set by
String | Use a SimpleDateFormat object to parse string
| Expected format is yyyy-MM-dd'T'HH:mm:ss in UTC
Date | Set the date (same as DateTime(Date value)
|
Modifier and Type | Method and Description |
---|---|
DB.DateTime |
add(int field,
int value) |
int |
compareTo(DB.DateTime another) |
DB.DateTime |
convertLocalToUtc()
Converts this DateTime object to UTC.
|
static Date |
convertLocalToUtc(Date date)
Converts time in UTC timezone to local time.
|
DB.DateTime |
convertUtcToLocal()
Converts this DateTime object to UTC.
|
static Date |
convertUtcToLocal(Date date)
Converts time in local timezone to UTC time.
|
boolean |
equals(Object obj)
Compare this instance to another instance of Db.DateTime or another Date object
|
DB.DateTime |
getDate()
Gets the Date component of this instance.
|
Date |
getValue()
Get the Date object or null if this instance is null
|
static DB.DateTime |
now() |
Duration |
subtract(DB.DateTime date)
Subtracts the specified date from this instance.
|
long |
toLong()
return the long value of this date
|
String |
toString()
return the String representation of this object
|
public static final SimpleDateFormat DAY_N_TIME_FORMAT
public static final SimpleDateFormat DAY_FORMAT
public DateTime()
public DateTime(Date value)
value
- - value set from this objectpublic DateTime(Object value)
value
- - instance used to set valuepublic static DB.DateTime now()
public Date getValue()
public boolean equals(Object obj)
public long toLong()
Date.getTime()
public String toString()
DB
public Duration subtract(DB.DateTime date)
date
- specified datepublic DB.DateTime getDate()
public DB.DateTime add(int field, int value)
public static Date convertUtcToLocal(Date date)
date
- to be convertedpublic DB.DateTime convertUtcToLocal()
public static Date convertLocalToUtc(Date date)
date
- to be convertedpublic DB.DateTime convertLocalToUtc()
public int compareTo(DB.DateTime another)
compareTo
in interface Comparable<DB.DateTime>
Copyright © 2015 VersionOne, Inc.. All rights reserved.