-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathutil_test.go
40 lines (34 loc) · 941 Bytes
/
util_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/***************************************************************
*
* Copyright (c) 2015, Menglong TAN <[email protected]>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GPL licence
*
**************************************************************/
/**
*
*
* @file time_test.go
* @author Menglong TAN <[email protected]>
* @date Mon Aug 23 14:00:33 2015
*
**/
package main
import (
"fmt"
"github.com/crackcell/hpipe/util/time"
"testing"
stdtime "time"
)
func TestDateToGoFormat(t *testing.T) {
fmt.Println(time.DateToGoFormat("YYYYMMDD hh:mm:ss"))
fmt.Println(time.DateToGoFormat("YYYY-MM-DD hh:mm:ss"))
fmt.Println(time.DateToGoFormat("YY/M/D hh:mm:ss"))
}
func TestParse(t *testing.T) {
fmt.Println(time.Parse("20060102 03:04:05", "YYYYMMDD hh:mm:ss"))
}
func TestFormat(t *testing.T) {
fmt.Println(time.Format(stdtime.Now(), "YYYYMMDD hh:mm:ss"))
}