uniplaces/carbon

Incorrect daydatetime format string

sahutd opened this issue · 3 comments

func TestTimestampFormat(t *testing.T)  {
	c, err := carbon.CreateFromTimestamp(1624647416, "UTC")
	assert.Nil(t, err)
	assert.Equal(t, "Fri, Jun 25, 2021 6:56 PM", c.DayDateTimeString())
}

The above timestamp is from june 25 6:56pm utc
image

Error:      	Not equal: 
        	            	expected: "Fri, Jun 25, 2021 6:56 PM"
        	            	actual  : "Fri, Aug 25, 2021 6:56 PM"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-Fri, Jun 25, 2021 6:56 PM
        	            	+Fri, Aug 25, 2021 6:56 PM
        	Test:       	TestTimestampFormat

Issue is due to wrong format string used in

	DayDateTimeFormat   = "Mon, Aug 2, 2006 3:04 PM"

Do let me know if the project is accepting PRs. i can fix the above issue.

Do let me know if the project is accepting PRs. i can fix the above issue.

Yes we are accepting contributions :)

Hi @rntdrts I did a fix for this issue on PR #71