desktop / desktop/desktop

"Friendly" time stamp gives wrong times for some commits

Open
#18,009 3 comments 4 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
21.8k
Forks
10.5k
Avg merge
1d 15h
Merged PRs (30d)
25

Description

### The problem

At this exact time of writing:

- `Sat Jan 13 10:22:47 AM UTC 2024` according to `$Date -u`
- `Sat Jan 13 11:22` in human-friendly local time as shown by my OS

Looking at git commit history:

![image](https://github.com/desktop/desktop/assets/4851097/7528a26f-c11d-4c02-b3a0-98254d703517)

Thursday is not "1d" ago from time "now", neither in local nor in universal time.

Possibly "1d" is the answer GD's "Friendly Time" library provider gives you.

Unfortunately, it is wrong*. On any day X+1, claiming that something happened "1d" ago means it happened on day X.

\* A reasonable exception is for a conversation that takes place past midnight where you are, mentally, still located in the prior day. This is not context Github Desktop has available to it.

### Release version

2.8.1-linux1

### Operating system

Pop!_OS 22.04 LTS

### Steps to reproduce the behavior

Make a commit

Wait

Hover over it.

### Log files

_No response_

### Screenshots

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.