Package com.sun.star.util

Examples of com.sun.star.util.DateTime


    static private Timestamp getTimestamp(final Object obj)
    {
        final Timestamp ts;
        if (obj instanceof DateTime)
        {
            final DateTime unoTs = (DateTime) obj;
            final StringBuffer str = getDateString(unoTs.Year, unoTs.Month, unoTs.Day);
            str.append(' ');
            str.append(getTimeString(unoTs.Hours, unoTs.Minutes, unoTs.Seconds));
            str.append('.');
            str.append(unoTs.HundredthSeconds);
View Full Code Here


   
    public void updateDateFields() {
        try {
            XEnumeration xEnum = xTextFieldsSupplier.getTextFields().createEnumeration();
            Calendar cal = new GregorianCalendar();
            DateTime dt = new DateTime();
            dt.Day = (short) cal.get(Calendar.DAY_OF_MONTH);
            dt.Year = (short) cal.get(Calendar.YEAR);
            dt.Month = (short) cal.get(Calendar.MONTH);
            dt.Month++;
           
View Full Code Here

            Calendar cal = new GregorianCalendar();
            int year = cal.get(Calendar.YEAR);
            int month = cal.get(Calendar.MONTH);
            int day = cal.get(Calendar.DAY_OF_MONTH);
            DateTime currentDate = new DateTime();
            currentDate.Day = (short)day;
            currentDate.Month = (short)month;
            currentDate.Year = (short)year;
            DateUtils du = new DateUtils(xMSF, this.xTextDocument);
            int ff = du.getFormat( NumberFormatIndex.DATE_SYS_DDMMYY );
View Full Code Here

    */
    public void _getDateTimeModified() {
        try {
            String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
            String filename = dirname+"XSimpleFileAccess.txt";
            DateTime fTime = oObj.getDateTimeModified(filename);

            java.io.File the_file = new java.io.File(filename);
            long lastModified = the_file.lastModified();
            java.util.Date lastMod = new java.util.Date(lastModified);

View Full Code Here

     * Overrides compare method. Can compare <code>DateTime</code>
     * structures.
     */
    protected boolean compare(Object ob1, Object ob2) {
        if (ob1 instanceof DateTime && ob2 instanceof DateTime) {
            DateTime dt1 = (DateTime)ob1;
            DateTime dt2 = (DateTime)ob2;

            return dt1.Year == dt2.Year
                && dt1.Month == dt2.Month
                && dt1.Day == dt2.Day
                && dt1.Hours == dt2.Hours
View Full Code Here

    /**
     * Prints DateTime.
     */
    protected String toString(Object obj) {
        if (obj instanceof DateTime) {
            DateTime dt = (DateTime)obj;

            return dt.Year + ":" + dt.Month + ":" + dt.Day
                    + ":" + dt.Hours + ":" + dt.Minutes
                    + ":" + dt.Seconds + ":" + dt.HundredthSeconds;
        } else {
View Full Code Here

     */
    class DatePropertyTester extends PropertyTester {
        protected Object getNewValue(String propName,
                Object oldValue) {
            if (oldValue == null || util.utils.isVoid(oldValue)) {
                DateTime dt = new DateTime();

                dt.Year = 2000;
                dt.Month = 10;
                dt.Day = 18;
                dt.Hours = 19;
View Full Code Here

    public void setUpdateDate(Integer i) {
        cp_UpdateDate = i.intValue();
    }

    private int currentDate() {
        DateTime dt = JavaTools.getDateTime(System.currentTimeMillis());
        //System.out.println();
        return dt.Day + dt.Month * 100 + dt.Year * 10000;
    }
View Full Code Here

            log.println("...done");

            log.println("Checking meta-data updates...");

            String str;
            DateTime dt = new DateTime();
            Locale l = new Locale();
            int i;

            str = "me";
            xDP.setAuthor(str);
View Full Code Here

            tRes.tested("updateTimestamp()", Status.skipped(true)) ;
            return ;
        }

        try {
            DateTime newVal = row.getTimestamp(idx) ;
            newVal.Year ++ ;
            oObj.updateTimestamp(idx, newVal) ;
            DateTime getVal = row.getTimestamp(idx) ;
            result = ValueComparer.equalValue(newVal, getVal) ;
        } catch (SQLException e) {
            e.printStackTrace(log) ;
            result = false ;
        }
View Full Code Here

TOP

Related Classes of com.sun.star.util.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.