@Override public String toString() { return MDate.toIsoDateTime(value); }
public static String toDateString(Date date) { return toDateString(date, null); }
@Override public String toString() { return toIso8601(this); }
@Override public void start() { file = MApi.getFile(IApi.SCOPE.LOG,getClass().getCanonicalName() + "_" + MDate.toFileFormat(new Date()) + ".csv"); timer = new Timer(true); timer.schedule(new TimerTask() { @Override public void run() { doSave(); } }, 60000, 60000); }
public static SchedulerJob toIntervalJob(String interval, ITimerTask task) { if (interval.indexOf(',') > 0) { long s = 0; String sStr = MString.beforeIndex(interval,','); if (sStr.indexOf('-') > 0 || sStr.indexOf('.') > 0 || sStr.indexOf('/') > 0 ) // it's a date string s = MDate.toDate(sStr, new Date()).getTime(); else // it should be a time interval s = System.currentTimeMillis() + MPeriod.toTime(sStr, -1); // delay is in every case a time interval long l = MPeriod.toTime(MString.afterIndex(interval,','), -1); if (s > 0 && l > 0) return new IntervalWithStartTimeJob(s,l, task); } else { long l = MPeriod.toTime(interval, -1); if (l > 0) return new IntervalJob(l, task); } return null; }
public String toSqlDate(Date date) { return "'" + MDate.toIsoDate(date) + "'"; }
date = line; Date d = MDate.toDate(date, null); if (d != null) { d = MDate.toDateOnly(d); map.put(d.getDate() + "." + (d.getMonth()+1), msg);
public static String toDateTimeString(Date date) { return toDateTimeString(date, null); }
public static String toDateTimeSecondsString(Date date) { return toDateTimeSecondsString(date, null); }
@Override public String cast(Object in, String def) { if (in == null) return def; if (in instanceof String) return (String)in; if (in instanceof Date) return MDate.toIso8601((Date)in); if (in instanceof Calendar) return MDate.toIso8601((Calendar)in); if (in instanceof Throwable) return MCast.toString((Throwable)in); if (in instanceof byte[]) return MCast.toString((byte[])in); if (in.getClass().isArray()) Arrays.asList(in).toString(); return String.valueOf(in); }
/** * <p>rotate.</p> */ protected void rotate() { File oldFile = file; doUpdateFile(); if (file == null) { if (oldFile != null && out != null) { out.close(); out = null; } return; } if (file.exists() && file.isFile()) file.renameTo(new File(file.getParentFile(), MDate.toFileFormat(new Date()) + "." + file.getName() )); }
long s = 0; if (interval.indexOf('-') > 0 || interval.indexOf('.') > 0 || interval.indexOf('/') > 0 ) s = MDate.toDate(interval, new Date()).getTime(); else s = System.currentTimeMillis() + MPeriod.toTime(interval, -1);
public String toSqlDate(Date date) { return "'" + MDate.toIsoDate(date) + "'"; }
@Override public String convertToPresentation(Date value, Class<? extends String> targetType, Locale locale) throws com.vaadin.v7.data.util.converter.Converter.ConversionException { if (value == null || ((Date) value).getTime() == 0) return "-"; return MDate.toDateTimeString( ((Date) value) ); }
ch == null ? "" : ch.isConnected(), ch == null ? "" : ch.isClosed(), ch == null || ! (ch instanceof ServerJms) ? "" : MDate.toDateTimeSecondsString(new Date( ((ServerJms)ch).getLastActivity() )) );
@Override public String toString() { return MDate.toIsoDateTime(new Date(time)); }
@Override public void schedule(TimerTask task, Date time) { createService(null, task, "once:" + MDate.toIso8601(time)); }
protected void rotate() { if (!isRotate()) return; File oldFile = file; doUpdateFile(); if (file == null) { if (oldFile != null && out != null) { out.close(); out = null; } return; } if (file.exists() && file.isFile()) file.renameTo(new File(file.getParentFile(), MDate.toFileFormat(new Date()) + "." + file.getName() )); }