Skip to content

datetime object dayofyear and dayofwk issue #13

@djkirkham

Description

@djkirkham

netcdftime.datetime objects constructed directly don't have the correct day of year or day of week; they always give a value of 1 and -1 respectively. Objects returned by utime.num2date have the correct values, except for those with Julian calendars, which still have the issue.

>>> import netcdftime
>>> print netcdftime.__version__
1.4.1
>>> date = netcdftime.DatetimeNoLeap(2000, 1, 2)
>>> print repr(date)
netcdftime._netcdftime.DatetimeNoLeap(2000, 1, 2, 0, 0, 0, 0, -1, 1)
>>> print date.dayofyr 
1
>>> print date.dayofwk
-1

Python version: 2.7
netdf4 version: 1.2.7
Installed via conda forge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions