Example usage for org.joda.time DateTimeZone UTC

List of usage examples for org.joda.time DateTimeZone UTC

Introduction

In this page you can find the example usage for org.joda.time DateTimeZone UTC.

Prototype

DateTimeZone UTC

To view the source code for org.joda.time DateTimeZone UTC.

Click Source Link

Document

The time zone for Universal Coordinated Time

Usage

From source file:com.nominanuda.lang.DateTimeHelper.java

License:Apache License

public String nowToISO8601UtcSecs() {
    return toISO8601UtcSecs(new DateTime(DateTimeZone.UTC));
}

From source file:com.nominanuda.lang.DateTimeHelper.java

License:Apache License

public String nowToISO8601UtcMillis() {
    return toISO8601UtcMillis(new DateTime(DateTimeZone.UTC));
}

From source file:com.nominanuda.lang.DateTimeHelper.java

License:Apache License

public String nowToISO8601UtcDate() {
    return toISO8601UtcSecs(new DateTime(DateTimeZone.UTC));
}

From source file:com.osbitools.util.Date.java

License:LGPL

/**
 * Convert ISO 8601 date string into date
 * /*from w ww .  ja v  a  2 s. c om*/
 * @param sd Date string. Can be in format 
 * 
 * @throws ParseException
 */
public Date(String date) {
    // Remember original string
    _sd = date;

    _dts = new DateTime(date, DateTimeZone.UTC);
    this.setTime(_dts.getMillis());
}

From source file:com.palominolabs.crm.sf.soap.ApiUtils.java

License:Apache License

/**
 * Convert an {@link XMLGregorianCalendar} (assumed to be in UTC) into a {@link DateTime}.
 *
 * @param soapTime the UTC timestamp extracted from the SF soap layer
 *
 * @return a DateTime object representing the same time as the original soapTime
 *///w  ww . j  a  v a2  s. com
public static DateTime convertSFTimeToDateTime(XMLGregorianCalendar soapTime) {
    return new DateTime(soapTime.getYear(), soapTime.getMonth(), soapTime.getDay(), soapTime.getHour(),
            soapTime.getMinute(), soapTime.getSecond(), soapTime.getMillisecond(), DateTimeZone.UTC);
}

From source file:com.pandits.opensource.JodaTimeUtil.java

License:Open Source License

private DateTime createDateTime(Date startDate) {
    return new DateTime(startDate.getTime(), DateTimeZone.UTC);
}

From source file:com.passwordboss.android.analytics.AnalyticsHelperSegment.java

public static void logFreeToPaid(Context mContext, String subsciptionType, String subsciptionLevel,
        String subsciptionProvider, String subscriptionSource, String subscriptionMedium, String campaign) {
    try {/*from www .  jav  a 2s .co  m*/
        TreeMap<String, String> events = new TreeMap<>();
        DatabaseHelperSecure mDatabaseHelperSecure = DatabaseHelperSecure.getHelper(mContext,
                Pref.DATABASE_KEY);
        UserSubscriptionBll mUserSubscriptionBll = new UserSubscriptionBll(mDatabaseHelperSecure);
        UserSubscription mSubscription = mUserSubscriptionBll.getUserInfoByEmail(Pref.EMAIL);
        int days = Utils.calculateNumberOfDaySinceAccountCreated(
                new DateTime(mSubscription.getCreatedDate(), DateTimeZone.UTC));
        events.put(SUBSCIPTION_TYPE, mSubscription.getName());
        events.put(DAYS_SINCE_ACCOUNT_CREATED, days + "");
        int messageNumber = Integer.parseInt(Pref.getMessageNumber(mContext));
        if (messageNumber > 0) {
            messageNumber--;
        }
        events.put(IN_APP_MESSAGE_SHOWN, messageNumber + "");
        events.put(MESSAGE, MESSAGE + Pref.getMessageNumber(mContext));
        events.put(SUBSCIPTION_TYPE, subsciptionType);
        events.put(SUBSCIPTION_LEVEL, subsciptionLevel);
        events.put(SUBSCIPTION_PROVIDER, subsciptionProvider);
        events.put(SUBSCIPTION_SOURCE, subscriptionSource);
        events.put(SUBSCIPTION_MEDIUM, subscriptionMedium);
        events.put(CAMPAIGN, campaign);
        logCustomEvents(mContext, FREE_TO_PAID, events);
    } catch (Exception e) {
        // TODO: handle exception
    }
}

From source file:com.passwordboss.android.analytics.AnalyticsHelperSegment.java

public static void logInAppMarketing(Context mContext, String button, String buyButton) {
    try {//from   w w w .  j a  v  a2  s.c o  m
        DatabaseHelperSecure mDatabaseHelperSecure = DatabaseHelperSecure.getHelper(mContext,
                Pref.DATABASE_KEY);
        UserSubscriptionBll mUserSubscriptionBll = new UserSubscriptionBll(mDatabaseHelperSecure);
        UserSubscription mSubscription = mUserSubscriptionBll.getUserInfoByEmail(Pref.EMAIL);
        int days = Utils.calculateNumberOfDaySinceAccountCreated(
                new DateTime(mSubscription.getCreatedDate(), DateTimeZone.UTC));
        Pref.incrementMessageNumber(mContext);
        TreeMap<String, String> events = new TreeMap<>();
        events.put(MESSAGE, MESSAGE + Pref.getMessageNumber(mContext));
        events.put(BUTTON_CLICKED, button);
        if (BUTTON_CLICKED_VALUE_ONE_YEAR.equalsIgnoreCase(button)
                || BUTTON_CLICKED_VALUE_TWO_YEAR.equalsIgnoreCase(button)
                || BUTTON_CLICKED_VALUE_THREE_YEAR.equalsIgnoreCase(button)
                || BUTTON_CLICKED_VALUE_CANCELED.equalsIgnoreCase(button)) {
            events.put(MESSAGE_TEMPLATE, MESSAGE_TEMPLATE_VALUE);
        }
        if (!"".equals(buyButton)) {
            events.put(BUY_BUTTON, buyButton);
        }
        events.put(DAYS_SINCE_ACCOUNT_CREATED, days + "");
        logCustomEvents(mContext, IN_APP_MARKETING, events);
    } catch (Exception e) {
        // TODO: handle exception
    }
}

From source file:com.passwordboss.android.database.beans.SecureItemData.java

public void setCreatedDateNow() {
    setCreatedDate(DateTime.now(DateTimeZone.UTC).toDateTimeISO().toString());
}

From source file:com.passwordboss.android.database.beans.SecureItemData.java

public void setLastModifiedDateNow() {
    setLastModifiedDate(DateTime.now(DateTimeZone.UTC).toDateTimeISO().toString());
}