Package java.text

Examples of java.text.SimpleDateFormat


  public String formatDate(java.sql.Timestamp timestampObject)
  {
    if (timestampObject != null)
    {
      SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss");
      String dateString = dateFormatter.format(timestampObject);
      return (dateString);
    }else{
      return("");
    }
  }   // end formatDate(java.sql.Timestamp timestampObject)
View Full Code Here


        session.setAttribute("userobject", userObject);

        // print the server date/time and sessionID
        Date date = new Date();

        SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String currentDateTime = dateFormatter.format(date);

        writer.print(currentDateTime + "\n" + sessionID);
        return (true);
      }
      return (false);
View Full Code Here

      String timeZone    = userPref.getTimeZone();
      if(timeZone == null)
        timeZone = "EST";

      GregorianCalendar gCal = new GregorianCalendar(TimeZone.getTimeZone(timeZone));
      SimpleDateFormat dForm = new SimpleDateFormat(dateFormat);
      dForm.setCalendar(gCal);


      String typeOfOperation = request.getParameter(AccountConstantKeys.TYPEOFOPERATION);

      /*
 
View Full Code Here

      String timeZone    = userPref.getTimeZone();
      if(timeZone == null)
        timeZone = "EST";

      GregorianCalendar gCal = new GregorianCalendar(TimeZone.getTimeZone(timeZone));
      SimpleDateFormat dForm = new SimpleDateFormat(dateFormat);
      dForm.setCalendar(gCal);

      int expenseID = Integer.parseInt((String)request.getParameter("rowId"));

      ExpenseForm expenseForm =  new ExpenseForm();

      AccountFacade remote =(AccountFacade)accountFacadeHome.create();
      remote.setDataSource(dataSource);

      ExpenseVO expenseVO = remote.getExpenseVO(expenseID,individualID);

      expenseForm.setExpenseID(0);

      expenseForm.setGlAccountID(""+expenseVO.getGlAccountIDValue());

      expenseForm.setAmount(expenseVO.getAmount());
      expenseForm.setTitle(expenseVO.getTitle());
      expenseForm.setExpenseDescription(expenseVO.getExpenseDescription());

      expenseForm.setEntity(expenseVO.getEntity());
      expenseForm.setEntityID(""+expenseVO.getEntityIDValue());

      java.sql.Date date = expenseVO.getDateEntered();

      expenseForm.setDateEntered(dForm.format(date));

      expenseForm.setStatusID(""+expenseVO.getStatusIDValue());

      expenseForm.setEmployee(expenseVO.getEmployee());
      expenseForm.setEmployeeID(""+expenseVO.getEmployeeIDValue());
View Full Code Here

      String timeZone    = userPref.getTimeZone();
      if(timeZone == null)
        timeZone = "EST";

      GregorianCalendar gCal = new GregorianCalendar(TimeZone.getTimeZone(timeZone));
      SimpleDateFormat dForm = new SimpleDateFormat(dateFormat);
      dForm.setCalendar(gCal);

      String typeOfSave = null;

      if(request.getParameter("typeOfSave") != null)
        typeOfSave = (String)request.getParameter("typeOfSave");

      ExpenseForm expenseForm = (ExpenseForm) request.getAttribute("expenseform");

      int expenseID = 0;

      if(expenseForm != null)
        expenseID = expenseForm.getExpenseID();


      //Convert all strings to int
      expenseForm.convertFormbeanToValueObject();


      ExpenseVOX vox  = new ExpenseVOX(expenseForm);
      ExpenseVO expenseVO = vox.getVO();

      AccountFacadeHome hm = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
      AccountFacade remote =(AccountFacade)hm.create();
      remote.setDataSource(dataSource);

      if (expenseID > 0)
      {
        remote.updateExpense(expenseVO,individualID);
        expenseVO = remote.getExpenseVO(expenseID,individualID);

        //Set all elements in form.
        expenseForm.setExpenseID(expenseID);

        expenseForm.setGlAccountID(""+expenseVO.getGlAccountIDValue());
        java.sql.Date date = expenseVO.getDateEntered();

        expenseForm.setDateEntered(dForm.format(date));
        expenseForm.setItemLines(expenseVO.getItemLines());
        request.setAttribute("ItemLines", expenseVO.getItemLines());
      }//end of if (expenseID > 0)

      if(typeOfSave != null && typeOfSave.equals("savenew"))
View Full Code Here

      String timeZone    = userPref.getTimeZone();
      if(timeZone == null)
      timeZone = "EST";

      GregorianCalendar gCal = new GregorianCalendar(TimeZone.getTimeZone(timeZone));
      SimpleDateFormat dForm = new SimpleDateFormat(dateFormat);
      dForm.setCalendar(gCal);


      int expenseFormID = Integer.parseInt((String)request.getParameter("rowId"));
      HrExpenseForm hrexpenseForm= new HrExpenseForm();
     
View Full Code Here

    HttpSession session = request.getSession(true);
    com.centraview.common.UserObject userobjectd = (com.centraview.common.UserObject)session.getAttribute("userobject");
    //String sortElement = request.getParamter("sortElement");
    String returnStatus = "NewTimeSheet";

    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy - h:mm a");

    String ele = request.getParameter("rowId");
    Integer timesheetID = null;
    timesheetID = (Integer)request.getAttribute("timesheetID");
    int timeSheetId = 0;
View Full Code Here

      String timeZone = userPref.getTimeZone();
      if (timeZone == null)
        timeZone = "EST";

      GregorianCalendar gCal = new GregorianCalendar(TimeZone.getTimeZone(timeZone));
      SimpleDateFormat dForm = new SimpleDateFormat(dateFormat);
      dForm.setCalendar(gCal);

      String typeOfSave = null;

      if (request.getParameter("typeOfSave") != null)
        typeOfSave = request.getParameter("typeOfSave");

      // Convert all strings to int
      invenForm.convertFormbeanToValueObject();

      InventoryHome hm = (InventoryHome)CVUtility.getHomeObject(
          "com.centraview.account.inventory.InventoryHome", "Inventory");
      Inventory remote = hm.create();
      remote.setDataSource(dataSource);

      InventoryVO inventoryVO = new InventoryVO();

      ItemVO itemVO = new ItemVO();
      itemVO.setItemId(invenForm.getItemIDValue());

      inventoryVO.setItemVO(itemVO);

      inventoryVO.setQty(invenForm.getQty());

      inventoryVO.setStrIdentifier(invenForm.getIdentifier());
      inventoryVO.setStrDescription(invenForm.getDescription());

      inventoryVO.setIntLocationID(invenForm.getLocationIDValue());

      EntityVO entityVO = new EntityVO();
      entityVO.setContactID(invenForm.getManufactureIDValue());

      inventoryVO.setManufacturerVO(entityVO);

      entityVO = new EntityVO();
      entityVO.setContactID(invenForm.getVendorIDValue());

      inventoryVO.setVendorVO(entityVO);

      inventoryVO.setIntStatusID(invenForm.getStatusIDValue());
      entityVO = new EntityVO();
      entityVO.setContactID(invenForm.getSoldToIDValue());

      inventoryVO.setSoldToVO(entityVO);

      // for custom fields
      Vector customFieldVec = getCustomFieldVO(request, response);

      invenForm.setCustomFieldsVec(customFieldVec);
      inventoryVO.setCustomFieldsVec(customFieldVec);

      // for custom fields ends here

      if (invID > 0) {
        inventoryVO.setInventoryID(invID);
        remote.updateInventory(individualID, inventoryVO);
      }

      if (invID == 0) {
        inventoryVO = remote.insertInventory(individualID, inventoryVO);
        invenForm.setInventoryID(inventoryVO.getInventoryID());

        Timestamp timeStamp = inventoryVO.getModified();
        Date date = inventoryVO.getCreated();

        if (inventoryVO.getCreated() != null)
          invenForm.setCreated(dForm.format(date));

        if (inventoryVO.getModified() != null)
          invenForm.setModified(dForm.format(timeStamp));

      }

      if (typeOfSave != null) {
        if (typeOfSave.equals("savenew")) {
View Full Code Here

     
      // Format created time
      Timestamp timeStamp = catVO.getCreatedOn();
      if (timeStamp != null){
        Date d = new Date(timeStamp.getTime());
        DateFormat df = new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a");
        catForm.setCreated(df.format(d));
      }
     
      // Format modified time
      timeStamp = catVO.getModifiedOn();
      if (timeStamp != null){
        Date d = new Date(timeStamp.getTime());
        DateFormat df = new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a");
        catForm.setModified(df.format(d));
      }
     
      catForm.setOwner(catVO.getOwnerVO().getFirstName() + " "
        + catVO.getOwnerVO().getLastName());
      catForm.setOwnerid(new Integer(catVO.getCreatedBy()).toString());
View Full Code Here

      String timeZone    = userPref.getTimeZone();
      if(timeZone == null)
        timeZone = "EST";

      GregorianCalendar gCal = new GregorianCalendar(TimeZone.getTimeZone(timeZone));
      SimpleDateFormat dForm = new SimpleDateFormat(dateFormat);
      dForm.setCalendar(gCal);

      String typeOfSave = null;

      if(request.getParameter("typeOfSave") != null)
        typeOfSave = (String)request.getParameter("typeOfSave");

      ExpenseForm expenseForm = (ExpenseForm) request.getAttribute("expenseform");

      int expenseID = 0;

      if(expenseForm != null)
        expenseID = expenseForm.getExpenseID();


      //Convert all strings to int
      expenseForm.convertFormbeanToValueObject();

      //Put all item to ItemLines
      expenseForm.convertItemLines();

      ExpenseVOX vox  = new ExpenseVOX(expenseForm);
      ExpenseVO expenseVO = vox.getVO();

      AccountFacadeHome hm = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
      AccountFacade remote =(AccountFacade)hm.create();
      remote.setDataSource(dataSource);

      expenseVO = remote.createExpense(expenseVO,individualID);
      expenseForm.setExpenseID(expenseVO.getExpenseID());
      java.sql.Date date = expenseVO.getDateEntered();
      expenseForm.setDateEntered(dForm.format(date));

      expenseForm.setItemLines(expenseVO.getItemLines());
      request.setAttribute("ItemLines", expenseVO.getItemLines());

      if(typeOfSave != null && typeOfSave.equals("savenew"))
View Full Code Here

TOP

Related Classes of java.text.SimpleDateFormat

Copyright © 2018 www.massapicom. 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.