Package org.joda.time

Examples of org.joda.time.DateTime


    }
  }

  @Override
  public void jobBegin(AnalysisJob job) {
    String now = new DateTime().toString(DateTimeFormat.fullTime());
    _progressInformationPanel.addUserLog("Job begin (" + now + ")");
  }
View Full Code Here


    _progressInformationPanel.addUserLog("Job begin (" + now + ")");
  }

  @Override
  public void jobSuccess(AnalysisJob job) {
    String now = new DateTime().toString(DateTimeFormat.fullTime());
    _progressInformationPanel.addUserLog("Job success (" + now + ")");
    _progressInformationPanel.onSuccess();
  }
View Full Code Here

    _progressInformationPanel.updateProgress(table, currentRow);
  }

  @Override
  public void rowProcessingSuccess(AnalysisJob job, final Table table) {
    String now = new DateTime().toString(DateTimeFormat.fullTime());
    _progressInformationPanel.addUserLog("Row processing for " + table.getQualifiedLabel() + " finished (" + now
        + "). Generating results ...");
  }
View Full Code Here

        //DateTime dtFrom = new DateTime(1455, 1, 1, 1, 1, 1, 1);
        //DateTime dtTo = new DateTime(1960, 2, 10, 1, 1, 1, 1);
        if (model.getUnit() == DateTime.class) {
            paintUpperRulerForInterval(g2d,
                    new DateTime(new Date(min)),
                    new DateTime(new Date(max)));
        }

        g2d.setColor(settings.defaultStrokeColor);
        g2d.drawRect((int) sf, settings.tmMarginTop, sw, height - settings.tmMarginBottom - 1);

        double v = model.getValueFromFloat(currentMousePositionX * (1.0 / width));

        v += model.getMinValue();

        if (v != Double.NEGATIVE_INFINITY && v != Double.POSITIVE_INFINITY) {
            String str = "";
            int strw = 0;
            if (model.getUnit() == DateTime.class) {
                DateTime d = new DateTime(new Date((long) v));
                if (d != null) {

                    DateTimeFormatter fmt = DateTimeFormat.forPattern("dd/MM/yyyy HH:mm:ss");
                    str = fmt.withLocale(LOCALE).print(d);
                    strw = (int) (settings.tip.fontMetrics.getStringBounds(str, null)).getWidth() + 4;
View Full Code Here

    protected long getTimeInMillis() {
        return dt.getMillis()// For JDK 1.4 we can use "cal.getTimeInMillis()"
    }
   
    public static RubyTime newTime(Ruby runtime, long milliseconds) {
        return newTime(runtime, new DateTime(milliseconds));
    }
View Full Code Here

        adjustment = adjustment / 1000;

        time += adjustment;

        RubyTime newTime = new RubyTime(getRuntime(), getMetaClass());
        newTime.dt = new DateTime(time).withZone(dt.getZone());
        newTime.setUSec(micro);

        return newTime;
    }
View Full Code Here

        adjustment = adjustment / 1000;

        time -= adjustment;

        RubyTime newTime = new RubyTime(getRuntime(), getMetaClass());
        newTime.dt = new DateTime(time).withZone(dt.getZone());
        newTime.setUSec(micro);

        return newTime;
    }
View Full Code Here

        return str;
    }   

    public RubyObject mdump(final IRubyObject[] args) {
        RubyTime obj = (RubyTime)args[0];
        DateTime dateTime = obj.dt.withZone(DateTimeZone.UTC);
        byte dumpValue[] = new byte[8];
        int pe =
            0x1                                 << 31 |
            (dateTime.getYear()-1900)           << 14 |
            (dateTime.getMonthOfYear()-1)       << 10 |
            dateTime.getDayOfMonth()            << |
            dateTime.getHourOfDay();
        int se =
            dateTime.getMinuteOfHour()          << 26 |
            dateTime.getSecondOfMinute()        << 20 |
            (dateTime.getMillisOfSecond() * 1000 + (int)usec); // dump usec, not msec

        for(int i = 0; i < 4; i++) {
            dumpValue[i] = (byte)(pe & 0xFF);
            pe >>>= 8;
        }
View Full Code Here

   
    /* Time class methods */
   
    public static IRubyObject s_new(IRubyObject recv, IRubyObject[] args, Block block) {
        Ruby runtime = recv.getRuntime();
        RubyTime time = new RubyTime(runtime, (RubyClass) recv, new DateTime(getLocalTimeZone(runtime)));
        time.callInit(args,block);
        return time;
    }
View Full Code Here

            RubyTime other = (RubyTime) arg;
            time = new RubyTime(runtime, (RubyClass) recv, other.dt);
            time.setUSec(other.getUSec());
        } else {
            time = new RubyTime(runtime, (RubyClass) recv,
                    new DateTime(0L, getLocalTimeZone(runtime)));

            long seconds = RubyNumeric.num2long(arg);
            long millisecs = 0;
            long microsecs = 0;
View Full Code Here

TOP

Related Classes of org.joda.time.DateTime

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.