Skip to content

Timezone aware Timestamp.dayofyear does not report correct day  #13303

Closed
@tumalow-will

Description

@tumalow-will

Code Sample, a copy-pastable example if possible

import pandas as PD

time_str = '2015-10-01 23:59:00-04:00'
pd_dto = PD.to_datetime(time_str, utc=True).tz_convert('US/Eastern')

actual_yday = pd_dto.date().timetuple().tm_yday
print 'pandas thinks', pd_dto, 'is the', pd_dto.dayofyear, 'yday'
print 'when really its the', actual_yday

Expected Output

I expect the dayofyear to agree with tm_yday, but they do not.

output of pd.show_versions()

## INSTALLED VERSIONS

commit: None
python: 2.7.10.final.0
python-bits: 64
OS: Windows
OS-release: 8
machine: AMD64
processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.16.2
nose: 1.3.7
Cython: 0.22.1
numpy: 1.9.2
scipy: 0.15.1
statsmodels: 0.6.1
IPython: 3.2.0
sphinx: 1.3.1
patsy: 0.3.0
dateutil: 2.4.2
pytz: 2015.4
bottleneck: 1.0.0
tables: 3.2.0
numexpr: 2.4.3
matplotlib: 1.4.3
openpyxl: 1.8.5
xlrd: 0.9.3
xlwt: 1.0.0
xlsxwriter: 0.7.3
lxml: 3.4.4
bs4: 4.3.2
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.5
pymysql: None
psycopg2: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions