Changeset 4136


Ignore:
Timestamp:
09/29/03 17:59:52 (19 years ago)
Author:
piso
Message:

SYS::DEFAULT-TIME-ZONE

File:
1 edited

Legend:

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

    r4051 r4136  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: Time.java,v 1.7 2003-09-25 15:37:08 piso Exp $
     5 * $Id: Time.java,v 1.8 2003-09-29 17:59:52 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2323
    2424import java.io.File;
     25import java.util.TimeZone;
    2526
    2627public final class Time extends Lisp
     
    9091        }
    9192    };
     93
     94    private static final Primitive0 DEFAULT_TIME_ZONE =
     95        new Primitive0("default-time-zone", PACKAGE_SYS, false)
     96    {
     97        public LispObject execute() throws ConditionThrowable
     98        {
     99            TimeZone tz = TimeZone.getDefault();
     100            int offset = tz.getOffset(System.currentTimeMillis());
     101            // "Time zone values increase with motion to the west..."
     102            // Convert milliseconds to hours.
     103            return new Fixnum(- offset).divideBy(new Fixnum(3600000));
     104        }
     105    };
    92106}
Note: See TracChangeset for help on using the changeset viewer.