Package java.sql

Examples of java.sql.Timestamp


  {
    GregorianCalendar gc = new GregorianCalendar(currentTZ);
    gc.setTime(dt);
    gc.get(Calendar.YEAR);
    gc.setTimeZone(targetTZ);
    Timestamp nts = new Timestamp(gc.getTimeInMillis());
    return nts;
  }
View Full Code Here


      noteForm.setDetail(noteVO.getDetail());
      noteForm.setCreatedid(String.valueOf(noteVO.getCreatedBy()));
      noteForm.setCreatedby(noteVO.getCreatedByVO().getFirstName() + " " + noteVO.getCreatedByVO().getLastName());

      DateFormat df = new SimpleDateFormat("MMM-dd-yyyy hh:mm:ss a");
      Timestamp createdTimestamp = noteVO.getCreatedOn();
      String createdDateString = "";
      if (createdTimestamp != null) {
        Date valueDate = new Date(createdTimestamp.getTime());
        createdDateString = df.format(valueDate);
      }
      noteForm.setCreateddate(createdDateString);

      Timestamp modifiedTimestamp = noteVO.getModifiedOn();
      String modyfiedDateString = "";
      if (modifiedTimestamp != null) {
        Date valueDate = new Date(modifiedTimestamp.getTime());
        modyfiedDateString = df.format(valueDate);
      }
      noteForm.setModifieddate(modyfiedDateString);

      if (noteVO.getRelateEntity() > 0) {
View Full Code Here

          newEventHashMap.put("WhoShouldAttend", oldEvent.getWhoshouldattend());
          newEventHashMap.put("MaxAttendees", Integer.toString(oldEvent.getMaxattendees()));
          newEventHashMap.put("Moderator", Integer.toString(oldEvent.getModeratorid()));
          //newEventHashMap.put("StartDate", (Timestamp) oldEvent.getStartdate());
          //newEventHashMap.put("EndDate", (Timestamp) oldEvent.getEnddate());
          Timestamp startTimestamp = (Timestamp)oldEvent.getStartdate();
          Timestamp endTimestamp = (Timestamp)oldEvent.getEnddate();

          //This section SHOULD NOT NEED TO BE DONE.
          //The way Timestamps are currently handled means I have to do this this way.
          Calendar tempCalendar = new GregorianCalendar();
          //fix the start time
          tempCalendar.setTimeInMillis(startTimestamp.getTime());
          tempCalendar.add(Calendar.YEAR, 1900);
          startTimestamp.setTime(tempCalendar.getTimeInMillis());

          //fix the end time
          tempCalendar.setTimeInMillis(endTimestamp.getTime());
          tempCalendar.add(Calendar.YEAR, 1900);
          endTimestamp.setTime(tempCalendar.getTimeInMillis());
          //End of This section SHOULD NOT NEED TO BE DONE.

          newEventHashMap.put("StartDate", startTimestamp);
          newEventHashMap.put("EndDate", endTimestamp);
View Full Code Here

        int startday   = Integer.parseInt(day);
        int startmonth = Integer.parseInt(month) - 1;
        int startyear  = Integer.parseInt(year);
        GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone(timeZone));
        gc.set(startyear,startmonth,startday,0,0,0);
        return new  Timestamp(gc.getTimeInMillis());
    }
View Full Code Here

          && (promotionDetailListForm.getStartyear() != null)) {
        String startmonth = promotionDetailListForm.getStartmonth();
        String startday = promotionDetailListForm.getStartday();
        String startyear = promotionDetailListForm.getStartyear();
        try {
          Timestamp start = DateUtility.createTimestamp(startyear, startmonth, startday);
          promotionVO.setStartdate(start);
        } catch (Exception e) {
          logger.error("[execute]: Exception", e);
        }
      }

      if ((promotionDetailListForm.getEndmonth() != null)
          && (promotionDetailListForm.getEndday() != null)
          && (promotionDetailListForm.getEndyear() != null)) {
        String endmonth = promotionDetailListForm.getEndmonth();
        String endday = promotionDetailListForm.getEndday();
        String endyear = promotionDetailListForm.getEndyear();
        try {
          Timestamp end = DateUtility.createTimestamp(endyear, endmonth, endday);
          promotionVO.setEnddate(end);
        } catch (Exception e) {
          logger.error("[execute]: Exception", e);
        }
      }
View Full Code Here

      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));
View Full Code Here

        throw new Exception("Bad category");
      catForm.setCategoryname(catVO.getTitle());
      catForm.setParentcatid(catVO.getParent());
     
      // 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() + " "
View Full Code Here

   */
  public static Timestamp createTimestamp(String year, String month, String day, String hour, String min)
  {
    Calendar calendar = new GregorianCalendar(Integer.parseInt(year), Integer.parseInt(month) - 1,
        Integer.parseInt(day), Integer.parseInt(hour), Integer.parseInt(min));
    return new Timestamp(calendar.getTimeInMillis());
  }
View Full Code Here

    return new Timestamp(calendar.getTimeInMillis());
  }

  public static Date createDate(String year, String month, String day)
  {
    Timestamp ts = DateUtility.createTimestamp(year, month, day);
    return new Date(ts.getTime());
  }
View Full Code Here

      literatureform.setLiteraturenamevec(literaturenamevec);
      literatureform.setNames(strnames);

      if (literatureDetails.getDuebydate() != null)
      {
        Timestamp date = (Timestamp)literatureDetails.getDuebydate();

        String strMonth = "" + (date.getMonth() + 1);
        String strDay = "" + date.getDate();
        String strYear = "" + (date.getYear() + 1900);
        String strHours = "" + date.getHours();
        String strMins = "" + date.getMinutes();
        int hhmm[] = new int[2];
        hhmm[0] = Integer.parseInt(strHours.trim());
        hhmm[1] = Integer.parseInt(strMins.trim());
        String strTime = CVUtility.convertTime24HrsFormatToStr(hhmm);
        literatureform.setDuebymonth(strMonth);
View Full Code Here

TOP

Related Classes of java.sql.Timestamp

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.