panic: time: missing Location in call to Time.In
docker容器发布go项目出现以下问题:
panic: time: missing Location in call to Time.In
COPY --from=build /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai //注意路径
main.go
func init() {
//处理全局时区问题,删了剁手
sh, _ := time.LoadLocation("Asia/Shanghai")
time.Local = sh
}
定时任务:
task := cron.New() //创建定时任务
task.AddFunc(sysConfig.TaskConfig.ActivityConfig, startActivity) //添加一个定时任务,可以AddFunc 多次.
task.AddFunc(sysConfig.TaskConfig.ActivityConfig, stopActivity) //添加一个定时任务,可以AddFunc 多次.
task.AddFunc(sysConfig.TaskConfig.ActivityConfig, tasks.PullA8ReceiveBills)
task.AddFunc(sysConfig.TaskConfig.ActivityConfig, tasks.SyncPurchaseApplyState)
task.AddFunc(sysConfig.TaskConfig.ActivityConfig, tasks.SyncReturnApplyState) task.Start()
时间格式化:
var dateStr = time.Now().Format("2006-01-02 15:04:05")
结构体:(首字母大写,不然数据库绑定无法取值)
type A8btype struct {
Usercode string
Fullname string
TelAndAddress string
CreateDate time.Time
}
panic: time: missing Location in call to Time.In的更多相关文章
- xv6/sh.c
// Shell. #include "types.h" #include "user.h" #include "fcntl.h" // P ...
- 基于nginx的FastCGI的缓存配置
废话不多说了, 直接上配置, 其实 fastcgi_cache 和 proxy_cache 的配置基本一样: # !缓存文件存放目录 # levels 缓存层次 # keys_zone 缓存空间名和共 ...
- SAP MM Storage Location Missing in MD04 Result?
SAP MM Storage Location Missing in MD04 Result? Today I received a ticket from business team, a user ...
- PANIC: Missing emulator engine program for 'x86' CPU.
获取可用的Android模拟器 1:emulator -list-avds 获取可用的模拟器的名称(只用名称) 2: android list -avd 获取可用的模拟器(信息详细) 获取iO ...
- file is missing from source location:c\temp\batang.ttc
打开注册表 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink 在右侧找到 Micr ...
- Description Resource Path Location Type AndroidManifest.xml file missing!
这个问题又找了好久.国内回答的确不敢恭维. 本回答来自谷歌: This is build issue. Go to Menu in eclipse, Project>clean then P ...
- Android AVD启动报错: This AVD's configuration is missing a kernel file! Please ensure the file "kernel-qemu" is in the same location as your system image.
启动Android SDK manager重新下载安装
- Description Resource Path Location Type web.xml is missing and <failOnMissingWebXml> is set to true
点击Deployment Descriptor 选择Generate Deployment Descriptor Stub. 就会在 src/main/webapp 生成WEB-INF并且有web.x ...
- Description Resource Path Location Type Missing artifact com.********:framework:jar:1.0.2 pom.xml /项目名 line **** Maven Dependency Problem
问题具体描述如下图所示: 对于该问题本人是这么解决的. 在window下[Preferences]目录找到[Maven]下的[usersetting] 查看local repository 里面的路径 ...
随机推荐
- C#字符串类型
C#字符串类型(string)是一种引用类型,是System.String的别名,表示Unicode字符串. 两种表示方法: 1.“C#” 直接用双引号括起来. 2.使用@,@“c:\test”,可以 ...
- MVC4使用SignalR出现$.connection is undefined错误备忘
SignalR使用过程中一定要注意js的引用顺序,否则就会出现$.connection is undefined脚本错误.
- DateTimeToGreenUnix
@暗夜魔尊 { Unix date conversion support with time-zone detect } function DateTimeToGreenUnix(const AVal ...
- uni-app中Vuex的引用
//store 中 store.js import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) const store = new Vue ...
- springboot部署到tomcat
把spring-boot项目按照平常的web项目一样发布到tomcat容器下 多点经验: 1.保证运行环境的jdk和开发环境一致,不然class文件无法被编译 2.保证tomcat和java的版本匹配 ...
- python发送邮件554DT:SPM已解决
说明:本例使用163邮箱 一.报错信息 使用SMTP发送邮件遇到以下报错: 554, b'DT:SPM 163 smtp10,DsCowACXeOtmjRRdsY8aCw--.21947S2 1561 ...
- F4帮助
在INITIALIZATION之后添加 AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_month-low 事件,s_month-low为要添加的搜索帮助. 下面 ...
- tkinter + cefpython 仿美团桌面程序
使用js开发桌面程序目前是一个趋势,Electron是其中一个佼佼者,网上也不乏很多文章.今天主要是来讲一下cefpython. 用python的朋友,特别使用过tkinter开发过界面的,一定会觉得 ...
- 报错:java.sql.SQLException: The server
报错:java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized 在IDEA运行是报出例如相识的错误时: ...
- 跟我学SpringCloud | 第二篇:注册中心Eureka
Eureka是Netflix开源的一款提供服务注册和发现的产品,它提供了完整的Service Registry和Service Discovery实现.也是springcloud体系中最重要最核心的组 ...