Ignore:
Timestamp:
Jul 24, 2006, 6:13:42 AM (19 years ago)
Author:
rwlbuis
Message:

Reviewed by Darin.

http://bugzilla.opendarwin.org/show_bug.cgi?id=4258
Date().toString() only includes GMT offset, not timezone string

Use the info in tm_zone to append timezone abbreviation
to Date().toString().

  • kjs/date_object.cpp: (KJS::formatTime):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/date_object.cpp

    r15594 r15595  
    208208    } else {
    209209        int offset = abs(gmtoffset(t));
    210         snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d",
    211             t.tm_hour, t.tm_min, t.tm_sec,
    212             gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60);
     210        if (t.tm_zone) {
     211            snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d (%s)",
     212                t.tm_hour, t.tm_min, t.tm_sec,
     213                gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60, t.tm_zone);
     214        } else {
     215            snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d",
     216                t.tm_hour, t.tm_min, t.tm_sec,
     217                gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60);
     218        }
    213219    }
    214220    return UString(buffer);
Note: See TracChangeset for help on using the changeset viewer.