Examples of DateTimeZone


Examples of org.joda.time.DateTimeZone

    public static void setApplicationTimeZone(DateTimeZone tz) {
        globalTimezone = tz;
    }

    public static DateTime inUserTimeZone(DateTime timestamp) {
        DateTimeZone tz = globalTimezone;
        final User currentUser = UserService.current();
        if (currentUser != null && currentUser.getTimeZone() != null) {
            tz = currentUser.getTimeZone();
        }
        return timestamp.toDateTime(tz);
View Full Code Here

Examples of org.joda.time.DateTimeZone

    public static DateTime nowInUTC() {
        return DateTime.now(DateTimeZone.UTC);
    }

    public static int getUserTimeZoneOffset(User currentUser) {
        DateTimeZone tz = globalTimezone;

        if (currentUser != null && currentUser.getTimeZone() != null) {
            tz = currentUser.getTimeZone();
        }

        int offset = tz.getOffset(new DateTime().getMillis());

        return ((offset / 1000) / 60) * -1;
    }
View Full Code Here

Examples of org.joda.time.DateTimeZone

        return ((offset / 1000) / 60) * -1;
    }

    public static String getUserTimeZone(User currentUser) {
        DateTimeZone tz = globalTimezone;

        if (currentUser != null && currentUser.getTimeZone() != null) {
            tz = currentUser.getTimeZone();
        }

        return tz.toString();
    }
View Full Code Here

Examples of org.joda.time.DateTimeZone

        this.username = user.getName();
        this.fullname = user.getFullName();
        this.email = user.getEmail();
        this.password = "";
        this.permissions  = user.getPermissions();
        final DateTimeZone timeZone = user.getTimeZone();
        if (timezone != null) {
            this.timezone = timeZone.getID();
        }
        this.sessionTimeoutMs = user.getSessionTimeoutMs();
    }
View Full Code Here

Examples of org.joda.time.DateTimeZone

     */
    @DwrPermission(user = true)
    public String getImageChartData(int[] pointIds, int fromYear, int fromMonth, int fromDay, int fromHour,
            int fromMinute, int fromSecond, boolean fromNone, int toYear, int toMonth, int toDay, int toHour,
            int toMinute, int toSecond, boolean toNone, int width, int height) {
        DateTimeZone dtz = Common.getUser().getDateTimeZoneInstance();
        DateTime from = createDateTime(fromYear, fromMonth, fromDay, fromHour, fromMinute, fromSecond, fromNone, dtz);
        DateTime to = createDateTime(toYear, toMonth, toDay, toHour, toMinute, toSecond, toNone, dtz);

        StringBuilder htmlData = new StringBuilder();
        htmlData.append("<img src=\"achart/ft_");
View Full Code Here

Examples of org.joda.time.DateTimeZone

    @DwrPermission(user = true)
    public void getChartData(int[] pointIds, int fromYear, int fromMonth, int fromDay, int fromHour, int fromMinute,
            int fromSecond, boolean fromNone, int toYear, int toMonth, int toDay, int toHour, int toMinute,
            int toSecond, boolean toNone) {
        User user = Common.getUser();
        DateTimeZone dtz = user.getDateTimeZoneInstance();
        DateTime from = createDateTime(fromYear, fromMonth, fromDay, fromHour, fromMinute, fromSecond, fromNone, dtz);
        DateTime to = createDateTime(toYear, toMonth, toDay, toHour, toMinute, toSecond, toNone, dtz);
        DataExportDefinition def = new DataExportDefinition(pointIds, from, to);
        user.setDataExportDefinition(def);
    }
View Full Code Here

Examples of org.joda.time.DateTimeZone

    public static Date getTimeAsDate() {
        return new Date(getTime());
    }

    public static LocalDate getTimeAsLocalDate() {
        final DateTimeZone timeZone = DateTimeZone.forTimeZone(TimeZone.getDefault());
        return new LocalDate(getTime(), timeZone);
    }
View Full Code Here

Examples of org.joda.time.DateTimeZone

    public DateTime(final long millisSinceEpoch) {
        this.dateTime = new org.joda.time.DateTime(millisSinceEpoch, Defaults.getTimeZone());
    }

    public DateTime(final Date date, final TimeZone timeZone) {
        final DateTimeZone tz = DateTimeZone.forTimeZone(timeZone);
        this.dateTime = new org.joda.time.DateTime(date, tz);
    }
View Full Code Here

Examples of org.joda.time.DateTimeZone

    @Override
    public Time getTime(final String columnName) {
        try {
            final String string = set.getString(columnName);
            final DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm:ss");
            final DateTimeZone defaultTimeZone = Defaults.getTimeZone();
            final DateTime utcDate = formatter.withZone(defaultTimeZone).parseDateTime(string);
            return new Time(utcDate);
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        }
View Full Code Here

Examples of org.joda.time.DateTimeZone

    public DateTime(final long millisSinceEpoch) {
        this.dateTime = new org.joda.time.DateTime(millisSinceEpoch, Defaults.getTimeZone());
    }

    public DateTime(final Date date, final TimeZone timeZone) {
        final DateTimeZone tz = DateTimeZone.forTimeZone(timeZone);
        this.dateTime = new org.joda.time.DateTime(date, tz);
    }
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.