Package java.text

Examples of java.text.SimpleDateFormat.format()


            String text;
            if (layer2Text == null) {
                StringBuffer buf = new StringBuffer();
                buf.append("Digitally signed by ").append(PdfPKCS7.getSubjectFields((X509Certificate)certChain[0]).getField("CN")).append('\n');
                SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss z");
                buf.append("Date: ").append(sd.format(signDate.getTime()));
                if (reason != null)
                    buf.append('\n').append("Reason: ").append(reason);
                if (location != null)
                    buf.append('\n').append("Location: ").append(location);
                text = buf.toString();
View Full Code Here


     * @param millis the time in milliseconds
     * @param s the message
     */
    static void printlnWithTime(long millis, String s) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
        s = dateFormat.format(new java.util.Date()) + " " + formatTime(millis) + " " + s;
        System.out.println(s);
    }

    /**
     * Print the current time and a message to system out.
View Full Code Here

     *
     * @param s the message
     */
    protected void printTime(String s) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
        println(dateFormat.format(new java.util.Date()) + " " + s);
    }

    /**
     * Format the time in the format hh:mm:ss.1234 where 1234 is milliseconds.
     *
 
View Full Code Here

                break;
            }
            oldest.delete();
        }
        SimpleDateFormat sd = new SimpleDateFormat("yyMMdd-HHmmss");
        String date = sd.format(new Date());
        File zipFile = new File(root, "backup-" + date + "-" + node + ".zip");
        ArrayList<File> list = New.arrayList();
        File base = new File(sourcePath);
        listRecursive(list, base);
        if (list.size() == 0) {
View Full Code Here

      String oldName = flvo.getName();

      Calendar c = Calendar.getInstance();
      java.util.Date dt = c.getTime();
      DateFormat df = new SimpleDateFormat("MM_dd_yyyy_hh_mm_ss");
      String dateStamp = df.format(dt);

      // String newName = fileId + "_" + flvo.getTitle();

      String newName = "attachment_" + dateStamp + "_" + flvo.getTitle();
View Full Code Here

        CvFolderVO checkUserName = remote.getFolderByName(userid, cvfsuser.getFolderId(), userName);
        if (checkUserName != null) {
          // append a date time string to the end of the folder name.
          Calendar calendar = Calendar.getInstance();
          SimpleDateFormat df = new SimpleDateFormat("yyMMddHHmmss");
          userName += df.format(calendar.getTime());
        }
      } catch (CvFileException fe) {
        // if we get an exception it means the folder doesn't exist so we are cool.
      }
      CvFolderVO cvVo = new CvFolderVO();
View Full Code Here

          int rn = (new Random()).nextInt();
          Calendar c = Calendar.getInstance();
          java.util.Date dt = c.getTime();
          DateFormat df = new SimpleDateFormat("MM_dd_yyyy");
          String dateStamp = df.format(dt);

          CvFileVO flvo = new CvFileVO();
          flvo.setTitle("Error Log");
          flvo.setName("errorLog_" + indvID + "_" + rn + "_" + dateStamp + ".txt");
          messageList.put("fileName","errorLog_" + indvID + "_" + rn + "_" + dateStamp + ".txt");
View Full Code Here

  // ================== Format date/time/timestamp TO String ==================
  public static String format(Date date, String format)
    throws FunctionExecutionException {
    try {
            SimpleDateFormat sdf = new SimpleDateFormat(format);
            return sdf.format(date);
    } catch (IllegalArgumentException iae) {
      throw new FunctionExecutionException("ERR.015.001.0042", QueryPlugin.Util.getString("ERR.015.001.0042" , //$NON-NLS-1$ //$NON-NLS-2$
        iae.getMessage()));
    }
  }
View Full Code Here

  public String  getDisplayString()
  {   
    if ( memberValue != null )
    {
      DateFormat df = new SimpleDateFormat("MMM d, yyyy") ;
      return df.format(memberValue);
    }else
    {
      return "";
    }
  } 
View Full Code Here

      mesgFrom = mesgFrom.trim();

      String[] DateHeader = message.getHeader("Date");
      Date receiveDate = new Date(DateHeader[0]);
      SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
      String receivedDate = formatter.format(receiveDate);

      if (receivedDate != null && !(receivedDate.equals("")))
      {
        cvdl.setString(1, receivedDate);
      }else{
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.