Project

General

Profile

« Previous | Next » 

Revision 5418

Added by berkley almost 14 years ago

fixed some bugs in time handling for listObjects and getLogRecords

View differences:

CrudService.java
770 770
        EventLog el = EventLog.getInstance();
771 771
        if(fromDate == null)
772 772
        {
773
            System.out.println("setting fromdate from null");
773 774
            fromDate = new Date(1);
774 775
        }
775 776
        if(toDate == null)
776 777
        {
778
            System.out.println("setting todate from null");
777 779
            toDate = new Date();
778 780
        }
781
        
782
        System.out.println("fromDate: " + fromDate);
783
        System.out.println("toDate: " + toDate);
784
        
779 785
        String report = el.getReport(null, null, null, null, 
780 786
                new java.sql.Timestamp(fromDate.getTime()), 
781 787
                new java.sql.Timestamp(toDate.getTime()));
782 788
        
789
        //System.out.println("report: " + report);
790
        
783 791
        String logEntry = "<logEntry>";
784 792
        String endLogEntry = "</logEntry>";
785 793
        int startIndex = 0;
......
954 962
     * @return
955 963
     * @throws Exception
956 964
     */
957
    private Date parseDate(String s)
965
    public Date parseDate(String s)
958 966
      throws Exception
959 967
    {
960 968
        Date d = null;
......
982 990
                seconds = time.substring(time.lastIndexOf(":") + 1, time.indexOf("."));
983 991
                milliseconds = time.substring(time.indexOf(".") + 1, time.length());
984 992
            }
993
            else
994
            {
995
                seconds = time.substring(time.lastIndexOf(":") + 1, time.length());
996
            }
985 997
            /*System.out.println("time: " + "hour: " + new Integer(hour).intValue() + 
986 998
                    " minute: " + new Integer(minute).intValue() + " seconds: " + 
987 999
                    new Integer(seconds).intValue() + " milli: " + 
988 1000
                    new Integer(milliseconds).intValue());*/
989 1001
            
990 1002
            //d = DateFormat.getDateTimeInstance().parse(date + " " + time);
991
            Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT-0"));
1003
            Calendar c = Calendar.getInstance(/*TimeZone.getTimeZone("GMT-0")*/TimeZone.getDefault());
992 1004
            c.set(new Integer(year).intValue(), new Integer(month).intValue() - 1, 
993 1005
                  new Integer(day).intValue(), new Integer(hour).intValue(), 
994 1006
                  new Integer(minute).intValue(), new Integer(seconds).intValue());

Also available in: Unified diff