org.soyatec.windowsazure.blob
Class DateTime

java.lang.Object
  extended by org.soyatec.windowsazure.blob.DateTime

public class DateTime
extends java.lang.Object

The signedstart and signedexpiry fields must be expressed as UTC times and must adhere to a valid ISO 8061 format. Supported ISO 8061 formats include the following:

Author:
xiaowei.ye@soyatec.com

Constructor Summary
DateTime(java.util.Date date)
          Construct a new DateTime object with a date.
DateTime(int year, int month, int date)
          Construct a new DateTime object with the integer year, month and date.
DateTime(int year, int month, int date, int hour, int minute)
          Construct a new DateTime object with the integer year, month, date, hour and minute.
DateTime(int year, int month, int date, int hour, int minute, int second)
          Construct a new DateTime object with the integer year, month, date, hour, minute and second.
DateTime(java.lang.String string)
          Construct a new DateTime object with a string date.
 
Method Summary
static java.lang.String create(int year, int month, int date)
          Group integer year, month and date into the "yyyy-MM-dd" format.
static java.lang.String create(int year, int month, int date, int hour, int minute)
          Group integer year, month, date, hour and minute into the "YYYY-MM-DDThh:mmTZD" format.
static java.lang.String create(int year, int month, int date, int hour, int minute, int second)
          Group integer year, month, date, hour, minute and second into the "YYYY-MM-DDThh:mm:ssTZD" format.
 java.lang.String getTimeString()
           
 java.util.Calendar toCalendar()
          Change dateTime obj to calendar.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateTime

public DateTime(java.util.Date date)
Construct a new DateTime object with a date.

Parameters:
date -

DateTime

public DateTime(java.lang.String string)
Construct a new DateTime object with a string date.

Parameters:
string -

DateTime

public DateTime(int year,
                int month,
                int date)
Construct a new DateTime object with the integer year, month and date. The format is yyyy-MM-dd.

Parameters:
year - The year of the dataTime, should be an integer.
month - The month of the dataTime, should be an integer.
date - The date of the dataTime, should be an integer.

DateTime

public DateTime(int year,
                int month,
                int date,
                int hour,
                int minute)
Construct a new DateTime object with the integer year, month, date, hour and minute. The format is YYYY-MM-DDThh:mmTZD.

Parameters:
year - The year of the dataTime, should be an integer.
month - The month of the dataTime, should be an integer.
date - The date of the dataTime, should be an integer.
hour - The hour of the dataTime, should be an integer.
minute - The minute of the dataTime, should be an integer.

DateTime

public DateTime(int year,
                int month,
                int date,
                int hour,
                int minute,
                int second)
Construct a new DateTime object with the integer year, month, date, hour, minute and second. The format is YYYY-MM-DDThh:mm:ssTZD.

Parameters:
year - The year of the dataTime, should be an integer.
month - The month of the dataTime, should be an integer.
date - The date of the dataTime, should be an integer.
hour - The hour of the dataTime, should be an integer.
minute - The minute of the dataTime, should be an integer.
second - The second of the dataTime, should be an integer.
Method Detail

getTimeString

public java.lang.String getTimeString()
Returns:
the timeString

create

public static java.lang.String create(int year,
                                      int month,
                                      int date)
Group integer year, month and date into the "yyyy-MM-dd" format.

Parameters:
year - The year of the dataTime, should be an integer.
month - The month of the dataTime, should be an integer.
date - The date of the dataTime, should be an integer.
Returns:
"yyyy-MM-dd" format string

create

public static java.lang.String create(int year,
                                      int month,
                                      int date,
                                      int hour,
                                      int minute)
Group integer year, month, date, hour and minute into the "YYYY-MM-DDThh:mmTZD" format.

Parameters:
year - The year of the dataTime, should be an integer.
month - The month of the dataTime, should be an integer.
date - The date of the dataTime, should be an integer.
hour - The hour of the dataTime, should be an integer.
minute - The minute of the dataTime, should be an integer.
Returns:
"YYYY-MM-DDThh:mmTZD" format string

create

public static java.lang.String create(int year,
                                      int month,
                                      int date,
                                      int hour,
                                      int minute,
                                      int second)
Group integer year, month, date, hour, minute and second into the "YYYY-MM-DDThh:mm:ssTZD" format.

Parameters:
year - The month of the dataTime, should be an integer.
month - The month of the dataTime, should be an integer.
date - The month of the dataTime, should be an integer.
hour - The month of the dataTime, should be an integer.
minute - The month of the dataTime, should be an integer.
second - The second of the dataTime, should be an integer.
Returns:
"YYYY-MM-DDThh:mm:ssTZD" format string

toCalendar

public java.util.Calendar toCalendar()
Change dateTime obj to calendar.

Returns:
Calendar object.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object