Package java.sql

Examples of java.sql.Timestamp


        helpTestSame("2005-05-17 22:35:33", 508659, "GMT", //$NON-NLS-1$ //$NON-NLS-2$
                     "America/New_York"); //$NON-NLS-1$
    }

    public void testCreateDate() {
        Timestamp t = Timestamp.valueOf("2004-06-30 23:39:10.1201"); //$NON-NLS-1$
        Date date = TimestampWithTimezone.createDate(t);
       
        Calendar cal = Calendar.getInstance();
       
        cal.setTimeInMillis(date.getTime());
View Full Code Here


        assertEquals(cal.get(Calendar.MONTH), Calendar.JUNE);
        assertEquals(cal.get(Calendar.DATE), 30);
    }
   
    public void testCreateTime() {
        Timestamp t = Timestamp.valueOf("2004-06-30 23:39:10.1201"); //$NON-NLS-1$
        Time date = TimestampWithTimezone.createTime(t);
       
        Calendar cal = Calendar.getInstance();
       
        cal.setTimeInMillis(date.getTime());
View Full Code Here


    // Source = TIMESTAMP
   
    @Test public void testTimestampToString() throws Exception {
        Timestamp ts = TimestampUtil.createTimestamp(103, 10, 1, 12, 5, 2, 0);       
        helpTest(LANG_FACTORY.createLiteral(ts, Timestamp.class), "string", "cast(to_timestamp('2003-11-01 12:05:02.0', 'yyyy-mm-dd hh:mi:ss.fffffffff') AS varchar(4000))"); //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here

      }
    });
    addSourceTransform(Date.class, new SourceTransform<Date, Timestamp>() {
      @Override
      public Timestamp transform(Date value) {
        return new Timestamp(value.getTime());
      }
    });
  }
View Full Code Here

           
            // recurrenceStartDate
            java.sql.Date recurrStartDate = (java.sql.Date)activityDetails.get("recurrenceStartDate");
            if (recurrStartDate != null)
            {
              Timestamp recurrStartTimestamp = new Timestamp(recurrStartDate.getTime());
              record.put("recurrenceStartDate", syncUtils.formatDate(recurrStartTimestamp));
            }else{
              record.put("recurrenceStartDate", "");
            }

            // recurrenceEndDate
            java.sql.Date recurrEndDate = (java.sql.Date)activityDetails.get("recurrenceEndDate");
            if (recurrEndDate != null)
            {
              Timestamp recurrEndTimestamp = new Timestamp(recurrEndDate.getTime());
              record.put("recurrenceEndDate", syncUtils.formatDate(recurrEndTimestamp));
            }else{
              record.put("recurrenceEndDate", "");
            }
           
View Full Code Here

      // set the From: field on the form bean
      emailForm.set("from", message.getMailFrom());
     
      // set the Date: field on the form bean
      Timestamp messageTimestamp = (Timestamp)message.getMessageDate();
      SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss");
      String date = dateFormatter.format(messageTimestamp);
      emailForm.set("date", date);
     
      // set the Subject: field on the form bean
View Full Code Here

          if (value instanceof Date) {
            value = new DateValue(tdv.getYear(), tdv.getMonth(), tdv.getDay(), tdv.getTimezoneInMinutes());
          } else if (value instanceof Time) {
            value = new TimeValue(tdv.getHour(), tdv.getMinute(), tdv.getSecond(), tdv.getMicrosecond(), tdv.getTimezoneInMinutes());
          } else if (value instanceof Timestamp) {
            Timestamp ts = (Timestamp)value;
            value = tdv.add(DayTimeDurationValue.fromMicroseconds(ts.getNanos() / 1000));
          }
          return (AtomicValue)value;
        }
    JPConverter converter = JPConverter.allocate(value.getClass(), null);
    return (AtomicValue)converter.convert(value, null);
View Full Code Here

        String duebymonth = ((LiteratureForm)form).getDuebymonth();
        String duebyday = ((LiteratureForm)form).getDuebyday();
        String duebyyear = ((LiteratureForm)form).getDuebyyear();
        String duebyTime = ((LiteratureForm)form).getDuebytime();
        try {
          Timestamp due = DateUtility.createTimestamp(duebyyear, duebymonth, duebyday, duebyTime);
          mapLiterature.put(" DueBy ", due);
        } catch (Exception e) {
          logger.error("[execute]: Exception", e);
        }
      }
View Full Code Here

        String startday = (String)dynaForm.get("startday");
        String startyear = (String)dynaForm.get("startyear");
        String startTime = (String)dynaForm.get("starttime");

        try {
          Timestamp start = DateUtility.createTimestamp(startyear, startmonth, startday, startTime);
          mapEvent.put("StartDate", start);
        } catch (Exception e) {
          logger.error("[execute] SaveEventHandler saveEvent thrown.", e);
        }
      }

      if ((dynaForm.get("endmonth") != null) && (dynaForm.get("endday") != null)
          && (dynaForm.get("endyear") != null)) {
        String endmonth = (String)dynaForm.get("endmonth");
        String endday = (String)dynaForm.get("endday");
        String endyear = (String)dynaForm.get("endyear");
        String endTime = (String)dynaForm.get("endtime");

        try {
          Timestamp end = DateUtility.createTimestamp(endyear, endmonth, endday, endTime);
          mapEvent.put("EndDate", end);
        } catch (Exception e) {
          logger.error("[execute] SaveEventHandler saveEvent thrown.", e);
        }
      }
View Full Code Here

     *
     * @return ...
     */
    public Timestamp getTimestampValue() {
        if ((type == DATE) && (value != null)) {
            return new Timestamp(((Date) value).getTime());
        }

        return null;
    }
View Full Code Here

TOP

Related Classes of java.sql.Timestamp

Copyright © 2015 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.