Examples of Timestamp


Examples of java.sql.Timestamp

   
    public static Timestamp createTimestamp(java.util.Date date) {
        if (date instanceof Timestamp) {
            return (Timestamp)date;
        }
        return new Timestamp(date.getTime());
    }
View Full Code Here

Examples of java.sql.Timestamp

        helpGetString1(func,  "CASE WHEN 1 = 0 THEN 'false' ELSE 'true' END")//$NON-NLS-1$
    }
   
    @Test public void testTimestampToString() throws Exception {
        Timestamp ts = TimestampUtil.createTimestamp(103, 10, 1, 12, 5, 2, 0);
        Function func = LANG_FACTORY.createFunction("convert"//$NON-NLS-1$
            new Expression[] {
                LANG_FACTORY.createLiteral(ts, Timestamp.class),
                LANG_FACTORY.createLiteral("string", String.class)}, //$NON-NLS-1$
            String.class);
View Full Code Here

Examples of java.sql.Timestamp

            Timestamp ts =  (Timestamp)obj;
            out.writeLong(ts.getTime());
            out.writeInt(ts.getNanos());
        }
        protected Object readObject(ObjectInput in) throws IOException {
            Timestamp ts = new Timestamp(in.readLong());
            ts.setNanos(in.readInt());
            return ts;
        }
View Full Code Here

Examples of java.sql.Timestamp

    public void helpTestSame(String startts,
                             int startnanos,
                             String starttz,
                             String endtz) {
        try {
            Timestamp start = getTimestamp(startts, startnanos, starttz);
            Timestamp end = getTimestamp(startts, startnanos, endtz);

            assertFalse("Initial timestamps should be different UTC times", start.getTime() == end.getTime()); //$NON-NLS-1$

            assertEquals(TimestampWithTimezone.createTimestamp(start, TimeZone.getTimeZone(starttz), Calendar.getInstance())
                                              .getTime(), TimestampWithTimezone.createTimestamp(end,
                                                                                                TimeZone.getTimeZone(endtz),
                                                                                                Calendar.getInstance()).getTime());
View Full Code Here

Examples of java.sql.Timestamp

     * @since 4.3
     */
    public void helpTestChange(String ts,
                               String endtz,
                               String expected) {
        Timestamp start = Timestamp.valueOf(ts);
        Calendar target = Calendar.getInstance(TimeZone.getTimeZone(endtz));
        assertEquals(expected,
                     TimestampWithTimezone.createTimestamp(start, TimeZone.getTimeZone("America/Chicago"), target).toString()); //$NON-NLS-1$        
    }
View Full Code Here

Examples of java.sql.Timestamp

                                   int startnanos,
                                   String starttz) throws ParseException {
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); //$NON-NLS-1$
        df.setTimeZone(TimeZone.getTimeZone(starttz));

        Timestamp ts = new Timestamp(df.parse(startts).getTime());
        ts.setNanos(startnanos);
        return ts;
    }
View Full Code Here

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

Examples of lineage2.gameserver.skills.TimeStamp

        int item_id = rset.getInt("item_id");
        long endTime = rset.getLong("end_time");
        long reuse = rset.getLong("reuse");
        if ((endTime - curTime) > 500)
        {
          TimeStamp stamp = new TimeStamp(item_id, endTime, reuse);
          player.addSharedGroupReuse(group, stamp);
        }
      }
      DbUtils.close(statement);
      statement = con.prepareStatement(DELETE_SQL_QUERY);
View Full Code Here

Examples of mil.nga.giat.geowave.store.dimension.Time.Timestamp

          object);
    }
    else {
      visibility = new byte[] {};
    }
    return new Timestamp(
        TimeUtils.getTimeMillis(object),
        visibility);
  }
View Full Code Here

Examples of ome.xml.model.primitives.Timestamp

      setSeries(series);
      if (series < imageNames.size()) {
        store.setImageName(imageNames.get(series), series);
      }
      if (acquiredDate.containsKey(series)) {
        store.setImageAcquisitionDate(new Timestamp(
            acquiredDate.get(series)), series);
      }
      store.setPixelsBinDataBigEndian(!isLittleEndian(), series, 0);
    }
    setSeries(0);
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.