Changeset 4897


Ignore:
Timestamp:
11/25/03 15:04:07 (18 years ago)
Author:
piso
Message:

SYS::DEFAULT-TIME-ZONE: avoid TimeZone?.getOffset(long) since Classpath hasn't
implemented it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/Time.java

    r4878 r4897  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: Time.java,v 1.12 2003-11-23 18:58:21 piso Exp $
     5 * $Id: Time.java,v 1.13 2003-11-25 15:04:07 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2323
    2424import java.io.File;
     25import java.util.Date;
    2526import java.util.TimeZone;
    2627
     
    111112        {
    112113            TimeZone tz = TimeZone.getDefault();
    113             int offset = tz.getOffset(System.currentTimeMillis());
     114            //int offset = tz.getOffset(System.currentTimeMillis());
     115            // Classpath hasn't implemented TimeZone.getOffset(long).
     116            int rawOffset = tz.getRawOffset();
     117            if (tz.inDaylightTime(new Date(System.currentTimeMillis())))
     118                rawOffset += tz.getDSTSavings();
    114119            // "Time zone values increase with motion to the west..."
    115120            // Convert milliseconds to hours.
    116             return new Fixnum(- offset).divideBy(new Fixnum(3600000));
     121            return new Fixnum(- rawOffset).divideBy(new Fixnum(3600000));
    117122        }
    118123    };
Note: See TracChangeset for help on using the changeset viewer.