feat(Go-StudyExample):2020/12/25:新增carbon时间操作库使用示例
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* @Author : huangzj
|
||||
* @Time : 2020/12/25 15:23
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
package carbon
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/uniplaces/carbon"
|
||||
"log"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestTimeCreate(t *testing.T) {
|
||||
c, err := carbon.Create(2020, time.July, 24, 20, 0, 0, 0, "Japan")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
fmt.Printf("The opening ceremony of next olympics will start at %s in Japan\n", c)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user