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

The following are Jave code examples for showing how to use toGMTString() of the java.util.Date class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: jdk8u-jdk   File: TimeParsing.java   View Source Code Vote up 5 votes
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 2
Project: jdk8u-jdk   File: TimeParsing.java   View Source Code Vote up 5 votes
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 3
Project: openjdk-jdk10   File: TimeParsing.java   View Source Code Vote up 5 votes
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 4
Project: openjdk-jdk10   File: TimeParsing.java   View Source Code Vote up 5 votes
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");
  }
}