# A script to get document editing time

**URL:** <https://krita-artists.org/t/a-script-to-get-document-editing-time/100697>\
**Category:** Develop\
**Created:** [August 31, 2024, 10:41pm UTC](https://krita-artists.org/t/a-script-to-get-document-editing-time/100697 "2024-08-31T22:41:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![YRH](https://krita-artists.org/user_avatar/krita-artists.org/yrh/32/232547_2.png) [@YRH](https://krita-artists.org/u/YRH)\
**Post date:** [August 31, 2024, 10:41pm UTC](https://krita-artists.org/t/a-script-to-get-document-editing-time/100697/1 "2024-08-31T22:41:57Z")

</div>

Hi, not sure if this is helpful to anyone else, or if there’s a better method, but I was curious about my total editing time of Krita documents, so I wrote this simple script. It should work in Bash on Windows (e.g. Git Bash) and Linux.

Can be used like this:

```auto
script.sh doc_A.kra
script.sh doc_*.kra # read multiple files

```

I haven’t tested it too extensively, seems to work 😃

```bash
#!/bin/bash
function get_time {
    unzip -p "$1" documentinfo.xml | \
    grep editing-time | \
    sed -E 's/ *<\/?editing-time>//g'
}

for f in "$@"
do
    if [-e "$f"]; then
        echo -e "$(get_time "$f")\t$f"
    else
        echo "File not found: $f"
    fi
done

```

Once you get an output, you can paste it into a spreadsheet or similar and get a sum, at least that’s what I did. The raw value is in seconds.

---

<div class="post-metadata">

**Author:** ![Michelist](https://krita-artists.org/user_avatar/krita-artists.org/michelist/32/65826_2.png) [@Michelist](https://krita-artists.org/u/Michelist)\
**Post date:** [September 1, 2024, 6:38am UTC](https://krita-artists.org/t/a-script-to-get-document-editing-time/100697/2 "2024-09-01T06:38:30Z")

</div>

> [@YRH](#):
>
> or if there’s a better method

Probably this one:  
[Timer Watch](https://krita-artists.org/t/timer-watch/3281/70)  
😉

Michelist

---

<div class="post-metadata">

**Author:** ![YRH](https://krita-artists.org/user_avatar/krita-artists.org/yrh/32/232547_2.png) [@YRH](https://krita-artists.org/u/YRH)\
**Post date:** [September 1, 2024, 11:25am UTC](https://krita-artists.org/t/a-script-to-get-document-editing-time/100697/3 "2024-09-01T11:25:35Z")

</div>

Thanks, that’s a nice plugin, but my situation is a bit different. I just wanted to check how much time I have spent painting in Krita in 2024, for example. I haven’t tracked the time in any way, so the built in counter in Krita documents is the best thing I have now.

---

<div class="post-metadata">

**Author:** ![Labi](https://krita-artists.org/user_avatar/krita-artists.org/labi/32/432_2.png) [@Labi](https://krita-artists.org/u/Labi)\
**Post date:** [September 1, 2024, 1:02pm UTC](https://krita-artists.org/t/a-script-to-get-document-editing-time/100697/4 "2024-09-01T13:02:39Z")

</div>

I also need the same thing, I asked the timer wach programmer for a similar function in that pluguin but it is not easy to use.  
is this: [Tab Information · EyeOdin/project\_pages Wiki · GitHub](https://github.com/EyeOdin/project_pages/wiki/Tab-Information)  
I also need the same function to calculate the time worked, it is the feature that the recorder has which detects only when you are working.

---

<div class="post-metadata">

**Author:** ![Michelist](https://krita-artists.org/user_avatar/krita-artists.org/michelist/32/65826_2.png) [@Michelist](https://krita-artists.org/u/Michelist)\
**Post date:** [September 1, 2024, 1:37pm UTC](https://krita-artists.org/t/a-script-to-get-document-editing-time/100697/5 "2024-09-01T13:37:55Z")

</div>

I was not aware of this inaccuracy, sorry.

Michelist
