Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • O openpyxl
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 282
    • Issues 282
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to a massive storm of spam, registration on this instance now requires explicit administrator approval. Sorry for the added friction, we're also looking into automatic filtering options.

  • openpyxl
  • openpyxl
  • Issues
  • #1973
Closed
Open
Issue created Feb 20, 2023 by Scott Talbert@swt2c

Conversion to datetime.timedelta doesn't work when using read-only mode

Openpyxl's conversion of duration-looking dates to datetime.timedelta doesn't seem to work when using read-only mode. Here's a quick reproducer. Cell A1 contains '50:22:13'.

import openpyxl

wb = openpyxl.load_workbook('test_duration.xlsx')
ws = wb.active

print(type(ws['A1'].value), ws['A1'].value)

wb1 = openpyxl.load_workbook('test_duration.xlsx', read_only=True)
ws1 = wb1.active

print(type(ws1['A1'].value), ws1['A1'].value)

Result:

$ python3 test_duration.py 
<class 'datetime.timedelta'> 2 days, 2:22:13
<class 'datetime.datetime'> 1900-01-02 02:22:13
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking