iamkun / iamkun/dayjs

make ToString() get local date

Open
#2,789 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I am sending the data to the server directly but it is taking by default UTC time so it generates a bug when making a database filter with the date time, maybe is it because when parsing datetime it make it by default UTC ?

`
toString() {
return this.$d.toUTCString()
}
`

**Expected behavior**
Consider to put by default local datetime

**Information**
- Day.js Version [e.g. v1.11.13]
- OS: [e.g. iOS]
- Browser [e.g. chrome 62]
- Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)]

Contributor guide

Open the contributing guide

Research direction

Review the toString() entry point shown in the issue and the library's existing date and timezone behavior. Confirm how local and UTC values are represented, then verify that the default string output uses local datetime without breaking documented serialization expectations.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.