Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package org.litesoft.deprecated;

import java.util.*;

/**
 * @noinspection deprecation, UnusedDeclaration
 */
public class LL_UtilDateAdaptor
{
    protected final int mUTCtoWallOffsetMinutes; // 0 = UTC, -600 = HT (Hawaii Time or more formally: HST = Alaska-Hawaii Standard Time)
    protected final int mTemporalFields; // 0 = Year, 1 = Year & Month, 2 = Year - Day, 3 = Year - Hour, 4 = Year - Min, 5 = Year - Sec, 6 = Year - MilliSec
    protected final int mYear, mMonth, mDay, mHour, mMin, mSec, mMilliSec;

    protected LL_UtilDateAdaptor( int pUTCtoWallOffsetMinutes, int pTemporalFields, //
                                  int pYear, int pMonth, int pDay, int pHour, int pMin, int pSec, int pMilliSec )
    {
        mUTCtoWallOffsetMinutes = pUTCtoWallOffsetMinutes;
        mTemporalFields = pTemporalFields;
        mYear = pYear;
        mMonth = (pMonth != 0) ? pMonth : 1;
        mDay = (pDay != 0) ? pDay : 1;
        mHour = pHour;
        mMin = pMin;
        mSec = pSec;
        mMilliSec = pMilliSec;
    }

    protected LL_UtilDateAdaptor( Date pWallDate, int pTemporalFields )
    {
        mUTCtoWallOffsetMinutes = -pWallDate.getTimezoneOffset();
        int dMonth = 1;
        int dDay = 1;
        int dHour = 0;
        int dMin = 0;
        int dSec = 0;
        int dMilliSec = 0;
        switch ( mTemporalFields = pTemporalFields )
        {
            case 6:
                long zMillisSinceEpoch = pWallDate.getTime();
                int zRawMilliSec = (int) (zMillisSinceEpoch % 1000L);
                dMilliSec = (zRawMilliSec >= 0) ? zRawMilliSec : (1000 + zRawMilliSec);
                // Fall Thru
            case 5:
                dSec = pWallDate.getSeconds();
                // Fall Thru
            case 4:
                dMin = pWallDate.getMinutes();
                // Fall Thru
            case 3:
                dHour = pWallDate.getHours();
                // Fall Thru
            case 2:
                dDay = pWallDate.getDate();
                // Fall Thru
            case 1:
                dMonth = pWallDate.getMonth() + 1;
                // Fall Thru
            default:
                break;
        }
        mYear = pWallDate.getYear() + 1900;
        mMonth = dMonth;
        mDay = dDay;
        mHour = dHour;
        mMin = dMin;
        mSec = dSec;
        mMilliSec = dMilliSec;
    }

    public static int dayOfWeek( Date pWallDate )
    {
        return pWallDate.getDay();
    }

    public static long parseUtilDate( String pUtilDateToString )
    {
        return Date.parse( pUtilDateToString );
    }

    public static long UTC( int pYear, int pMonth, int pDay, int pHour, int pMin, int pSec, int pMilliSec )
    {
        return Date.UTC( pYear - 1900, pMonth - 1, pDay, pHour, pMin, pSec ) + pMilliSec;
    }
}

Commits for litesoft/trunk/Java/deprecated/src/org/litesoft/deprecated/LL_UtilDateAdaptor.java

Diff revisions: vs.
Revision Author Commited Message
912 Diff Diff GeorgeS picture GeorgeS Fri 28 Jun, 2013 06:48:05 +0000

Revert to mixed & Working (PEDS & Prioritizer) code!

898 Diff Diff GeorgeS picture GeorgeS Sun 17 Mar, 2013 21:46:33 +0000

Temporal!!!

897 Diff Diff GeorgeS picture GeorgeS Mon 25 Feb, 2013 02:04:34 +0000
870 Diff Diff GeorgeS picture GeorgeS Mon 26 Nov, 2012 01:57:27 +0000
866 Diff Diff GeorgeS picture GeorgeS Sun 25 Nov, 2012 22:13:32 +0000

Updated Field Name

865 Diff Diff GeorgeS picture GeorgeS Mon 19 Nov, 2012 02:25:29 +0000
851 Diff Diff GeorgeS picture GeorgeS Mon 08 Oct, 2012 00:05:32 +0000

Breaking the code as Temporal changes are implemented...

50 GeorgeS picture GeorgeS Tue 13 Apr, 2010 11:51:38 +0000