We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61cf77d commit aff8726Copy full SHA for aff8726
php.go
@@ -22,9 +22,9 @@ func Time() int64 {
22
return time.Now().Unix()
23
}
24
25
-func Date(format ...string, timestamp int64) string {
+func Date(format string, timestamp int64) string {
26
if len(format) > 0 {
27
- return time.Unix(timestamp, 0).Format(format[0])
+ return time.Unix(timestamp, 0).Format(format)
28
29
30
return time.Unix(timestamp, 0).Format(GO_TIME_LAYOUT)
php_test.go
@@ -12,7 +12,7 @@ func TestTime(t *testing.T) {
12
13
func TestDate(t *testing.T) {
14
tt := Time()
15
- dd := Date(tt)
+ dd := Date("2006#01#02", tt)
16
t.Log(dd)
17
18
0 commit comments