APISonar


java.util.Date.Date

> java > util > Date > Date
java APIs util APIs Date APIs Date APIs

Example 1
Date setBatchTime() {
    batchTime = new Date();
    return batchTime;
  }
Example 2
public Date getCreatedDate()
	{
		return new Date(m_createdTime.getTime());
	}
Example 3
public Date getCreationTime()
    {
        return new Date( session.getCreationTime() );
    }
Example 4
public Date getLastWriteTime()
    {
        return new Date( session.getLastWriteTime() );
    }
Example 5
public static Date getLastModified(
            final File file) {
        if (!exists(file)) {
            return null;
        }
        Date date = null;
        try {
            long modif = file.lastModified();
            date = new Date(modif);
        }  catch (SecurityException ex) {
            ex=null;
        }
        return date;
    }
Example 6
public void testDateArrayField() throws Exception {
        Date date1 = new Date();
        Date date2 = new Date(date1.getTime() + 1000);

        Date[] dateArr = new Date[] { date1, date2 };

        assertTrue(Arrays.equals(dateArr, builder("C").setField("da", dateArr).build().<Date[]>field("da")));
    }
Example 7
public Date fromString(String s) throws PropertyAccessException
    {
        try
        {
            Date d = new Date(s);
            return d;
        }
        catch (NumberFormatException e)
        {
            throw new PropertyAccessException(e.getMessage());
        }
    }
Example 8
private Date parse(String text, boolean strict) {
    Date curDate = new Date();
    Date date = new Date(curDate.getYear(), curDate.getMonth(),
        curDate.getDate());
    int charsConsumed = parse(text, 0, date, strict);
    if (charsConsumed == 0 || charsConsumed < text.length()) {
      throw new IllegalArgumentException(text);
    }
    return date;
  }
Example 9
public Date getStoreCreationDate()
    {
        return new Date( databaseInfoSupplier.get().getStoreCreationDate() );
    }
Example 10
public Date getEnableOn()
    {
        return enableOn == -1 ? null : new Date( enableOn );
    }
Example 11
public void setLogdate()
	{
		logdate=new Date();
	}
Example 12
protected static Date getValidDate(PKIXParameters paramsPKIX)
    {
        Date validDate = paramsPKIX.getDate();

        if (validDate == null)
        {
            validDate = new Date();
        }

        return validDate;
    }
Example 13
public void testSetDate() {
        Date date = new Date();
        mField.setDate(date);
        assertThat(mField.getDate()).isEqualTo(date);
        date.setTime(date.getTime() + 86400000);
        mField.setTime(date.getTime());
        assertThat(mField.getDate()).isEqualTo(date);

        assertThat(mField.setFromString("2017-03-23")).isTrue();
        assertThat(mField.getLocalizedDateString()).isEqualTo("2017-03-23");
    }
Example 14
public void test_cccc() {
    Date date = new Date(2006 - 1900, 6, 27, 13, 10, 10);
    assertEquals("Thursday", DateTimeFormat.getFormat("cccc").format(date));
  }
Example 15
public Date getValidTo() {
        // Maximum possible date representable on the card
        return new Date(2159 - 1900, 6 - 1, 6);
    }
Example 16
public Object getValue() {

		if (parameter.getClass().isInstance(Date.class)) {
			return new Date(((Date) parameter).getTime());
		}
		else {
			return parameter;
		}
	}
Example 17
public static String getISO8601(Date date) {
		if ( date == null ) {
			date = new Date();
		}
		SimpleDateFormat isoFormat = new SimpleDateFormat(ISO_8601_FORMAT);
		isoFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
		String timestamp = isoFormat.format(date);
		timestamp = timestamp.replace("GMT", "Z");
		return timestamp;
	}
Example 18
public String toString() {
        return "MyVote{" +
                "\n     ballotList=" + ballotList +
                ",\n     secretKeyEncoded=" + Utilities.bytesAsHexString(secretKeyEncoded) +
                ",\n     blindVotePayload=" + blindVote +
                ",\n     date=" + new Date(date) +
                ",\n     revealTxId='" + revealTxId + '\'' +
                "\n}";
    }
Example 19
public Date getDate() {
        try {
            return dateFormat.parse(getText());
        } catch (ParseException e) {
            return new Date();
        }
    }
Example 20
public void testToBytes()
    {
        Assert.assertNull(accessor.toBytes(null));

        Date d1 = new Date(4);

        byte[] b = accessor.toBytes(d1);

        Date d2 = accessor.fromBytes(Date.class, b);

        Assert.assertEquals(d1, d2);

    }
Example 21
public Date appdate() {
        // the date when the url appeared first
        return new Date(appdate);
    }
Example 22
public Date getLastConnectionActivityTime() {
        if (lastConnectionActivityTicks != null) {
            return new Date(lastConnectionActivityTicks);
        }

        return null;
    }
Example 23
public static Date fromMillisUtc(long millisecondsFromEpoch) {

    return new Date(millisecondsFromEpoch);
  }
Example 24
public static String createFileName() {
        Date date = new Date(System.currentTimeMillis());
        SimpleDateFormat format = new SimpleDateFormat(DEFAULT_FILE_PATTERN);
        return format.format(date);
    }
Example 25
public void    setInteger(long number)
	{
		this.date = new Date(number);
	}