Java Code Examples for java.util.Date#toGMTString()

The following examples show how to use java.util.Date#toGMTString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CalendarResultHandler.java    From barterli_android with Apache License 2.0 6 votes vote down vote up
@Override
public CharSequence getDisplayContents() {
    CalendarParsedResult calResult = (CalendarParsedResult) getResult();
    StringBuilder result = new StringBuilder(100);
    ParsedResult.maybeAppend(calResult.getSummary(), result);
    Date start = calResult.getStart();
    String startString = start.toGMTString();
    appendTime(startString, result, false, false);

    Date end = calResult.getEnd();
    String endString = end.toGMTString();
    if (endString != null) {
        boolean sameStartEnd = startString.equals(endString);
        appendTime(endString, result, true, sameStartEnd);
    }

    ParsedResult.maybeAppend(calResult.getLocation(), result);
    ParsedResult.maybeAppend(calResult.getAttendees(), result);
    ParsedResult.maybeAppend(calResult.getDescription(), result);
    return result.toString();
}
 
Example 2
Source File: TimeParsing.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static  void checkUTC(Date d0, byte[] b, String text) throws Exception {
  Date d1 = decodeUTC(b);
  if( !d0.equals(d1) ) {
    throw new Exception("UTCTime " + text + " failed: " + d1.toGMTString());
  } else {
    System.out.println("UTCTime " + text + " ok");
  }
}
 
Example 3
Source File: ListAdapter.java    From Building-Professional-Android-Applications with MIT License 5 votes vote down vote up
String toText(Date date) {
    if (date == null) {
        return "";
    }

    return date.toGMTString();
}
 
Example 4
Source File: ListAdapter.java    From Building-Professional-Android-Applications with MIT License 5 votes vote down vote up
String toText(Date date) {
    if (date == null) {
        return "";
    }

    return date.toGMTString();
}
 
Example 5
Source File: ListAdapter.java    From Building-Professional-Android-Applications with MIT License 5 votes vote down vote up
String toText(Date date) {
    if (date == null) {
        return "";
    }

    return date.toGMTString();
}
 
Example 6
Source File: TimeParsing.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static  void checkUTC(Date d0, byte[] b, String text) throws Exception {
  Date d1 = decodeUTC(b);
  if( !d0.equals(d1) ) {
    throw new Exception("UTCTime " + text + " failed: " + d1.toGMTString());
  } else {
    System.out.println("UTCTime " + text + " ok");
  }
}
 
Example 7
Source File: ListAdapter.java    From Building-Professional-Android-Applications with MIT License 5 votes vote down vote up
String toText(Date date) {
    if (date == null) {
        return "";
    }

    return date.toGMTString();
}
 
Example 8
Source File: ListAdapter.java    From Building-Professional-Android-Applications with MIT License 5 votes vote down vote up
String toText(Date date) {
    if (date == null) {
        return "";
    }

    return date.toGMTString();
}
 
Example 9
Source File: TimeParsing.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static  void checkUTC(Date d0, byte[] b, String text) throws Exception {
  Date d1 = decodeUTC(b);
  if( !d0.equals(d1) ) {
    throw new Exception("UTCTime " + text + " failed: " + d1.toGMTString());
  } else {
    System.out.println("UTCTime " + text + " ok");
  }
}
 
Example 10
Source File: ListAdapter.java    From Building-Professional-Android-Applications with MIT License 5 votes vote down vote up
String toText(Date date) {
    if (date == null) {
        return "";
    }

    return date.toGMTString();
}
 
Example 11
Source File: TimeParsing.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static  void checkGeneralized(Date d0, byte[] b, String text) throws Exception {
  Date d1 = decodeGeneralized(b);
  if( !d0.equals(d1) ) {
    throw new Exception("GeneralizedTime " + text + " failed: " + d1.toGMTString());
  } else {
    System.out.println("GeneralizedTime " + text + " ok");
  }
}
 
Example 12
Source File: TimeParsing.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static  void checkUTC(Date d0, byte[] b, String text) throws Exception {
  Date d1 = decodeUTC(b);
  if( !d0.equals(d1) ) {
    throw new Exception("UTCTime " + text + " failed: " + d1.toGMTString());
  } else {
    System.out.println("UTCTime " + text + " ok");
  }
}
 
Example 13
Source File: ListAdapter.java    From Building-Professional-Android-Applications with MIT License 5 votes vote down vote up
String toText(Date date) {
    if (date == null) {
        return "";
    }

    return date.toGMTString();
}
 
Example 14
Source File: ListAdapter.java    From Building-Professional-Android-Applications with MIT License 5 votes vote down vote up
String toText(Date date) {
    if (date == null) {
        return "";
    }

    return date.toGMTString();
}
 
Example 15
Source File: TimeParsing.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static  void checkGeneralized(Date d0, byte[] b, String text) throws Exception {
  Date d1 = decodeGeneralized(b);
  if( !d0.equals(d1) ) {
    throw new Exception("GeneralizedTime " + text + " failed: " + d1.toGMTString());
  } else {
    System.out.println("GeneralizedTime " + text + " ok");
  }
}
 
Example 16
Source File: ListAdapter.java    From Building-Professional-Android-Applications with MIT License 5 votes vote down vote up
String toText(Date date) {
    if (date == null) {
        return "";
    }

    return date.toGMTString();
}
 
Example 17
Source File: TimeParsing.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static  void checkGeneralized(Date d0, byte[] b, String text) throws Exception {
  Date d1 = decodeGeneralized(b);
  if( !d0.equals(d1) ) {
    throw new Exception("GeneralizedTime " + text + " failed: " + d1.toGMTString());
  } else {
    System.out.println("GeneralizedTime " + text + " ok");
  }
}
 
Example 18
Source File: TimeParsing.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static  void checkUTC(Date d0, byte[] b, String text) throws Exception {
  Date d1 = decodeUTC(b);
  if( !d0.equals(d1) ) {
    throw new Exception("UTCTime " + text + " failed: " + d1.toGMTString());
  } else {
    System.out.println("UTCTime " + text + " ok");
  }
}
 
Example 19
Source File: TimeParsing.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static  void checkUTC(Date d0, byte[] b, String text) throws Exception {
  Date d1 = decodeUTC(b);
  if( !d0.equals(d1) ) {
    throw new Exception("UTCTime " + text + " failed: " + d1.toGMTString());
  } else {
    System.out.println("UTCTime " + text + " ok");
  }
}
 
Example 20
Source File: TimeParsing.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static  void checkUTC(Date d0, byte[] b, String text) throws Exception {
  Date d1 = decodeUTC(b);
  if( !d0.equals(d1) ) {
    throw new Exception("UTCTime " + text + " failed: " + d1.toGMTString());
  } else {
    System.out.println("UTCTime " + text + " ok");
  }
}