-
Notifications
You must be signed in to change notification settings - Fork 3
/
time.go
80 lines (65 loc) · 1.79 KB
/
time.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package convert
import (
"time"
"github.com/araddon/dateparse"
)
func (stdRecipes) nilToTime(Converter, NilValue, *time.Time) error {
return nil
}
func (stdRecipes) intToTime(c Converter, in int, out *time.Time) error {
*out = time.Unix(int64(in), 0)
return nil
}
func (stdRecipes) int8ToTime(c Converter, in int8, out *time.Time) error {
*out = time.Unix(int64(in), 0)
return nil
}
func (stdRecipes) int16ToTime(c Converter, in int16, out *time.Time) error {
*out = time.Unix(int64(in), 0)
return nil
}
func (stdRecipes) int32ToTime(c Converter, in int32, out *time.Time) error {
*out = time.Unix(int64(in), 0)
return nil
}
func (stdRecipes) int64ToTime(_ Converter, in int64, out *time.Time) error {
*out = time.Unix(in, 0)
return nil
}
func (stdRecipes) uintToTime(c Converter, in uint, out *time.Time) error {
*out = time.Unix(int64(in), 0)
return nil
}
func (stdRecipes) uint8ToTime(c Converter, in uint8, out *time.Time) error {
*out = time.Unix(int64(in), 0)
return nil
}
func (stdRecipes) uint16ToTime(c Converter, in uint16, out *time.Time) error {
*out = time.Unix(int64(in), 0)
return nil
}
func (stdRecipes) uint32ToTime(c Converter, in uint32, out *time.Time) error {
*out = time.Unix(int64(in), 0)
return nil
}
func (stdRecipes) uint64ToTime(_ Converter, in uint64, out *time.Time) error {
*out = time.Unix(int64(in), 0)
return nil
}
func (stdRecipes) float32ToTime(_ Converter, in float32, out *time.Time) error {
*out = time.Unix(int64(in), 0)
return nil
}
func (stdRecipes) float64ToTime(_ Converter, in float64, out *time.Time) error {
*out = time.Unix(int64(in), 0)
return nil
}
func (stdRecipes) stringToTime(_ Converter, in string, out *time.Time) error {
if in == "" {
*out = time.Time{}
return nil
}
var err error
*out, err = dateparse.ParseAny(in)
return err
}