//获取本地location
toBeCharge := "2015-01-01 00:00:00" //待转化为时间戳的字符串 注意 这里的小时和分钟还要秒必须写 因为是跟着模板走的 修改模板的话也可以不写
timeLayout := "2006-01-02 15:04:05" //转化所需模板
loc, _ := ("Local") //重要:获取时区
theTime, _ := (timeLayout, toBeCharge, loc) //使用模板在对应时区转化为类型
sr := () //转化为时间戳 类型是int64
(theTime) //打印输出theTime 2015-01-01 15:15:00 +0800 CST
(sr) //打印输出时间戳 1420041600
//时间戳转日期
dataTimeStr := (sr, 0).Format(timeLayout) //设置时间戳 使用模板格式化为日期字符串
(dataTimeStr)