dqn8235
2017-07-31 07:51
浏览 188
已采纳

golang上的公历日历包

I m wrking on a project, and I want to make a date variable with the gregorian calendar in goLang, I've searched about it, but i didn't found an answer here is what i want to do with in golang in a java type code

try {
                final Calendar gc = new GregorianCalendar();
                gc.setTime(simpleDateFormat.parse(callEndDateTime));
                gc.add(Calendar.SECOND, -1 * duration);
                callStartDateTime = simpleDateFormat.format(gc.getTime());
            } catch (final ParseException parseException) {
                LOGGER.error("Couldn't parse the given date: " + callEndDateTime, parseException);
                callStartDateTime = null;
            }

thanks for helping me!

图片转代码服务由CSDN问答提供 功能建议

我在一个项目中工作,我想用goLang中的公历创建一个日期变量,我 ve进行了搜索,但是我没有找到答案 这是我想用java类型代码在golang中进行的操作

  try {
 final Calendar gc  = new GregorianCalendar(); 
 gc.setTime(simpleDateFormat.parse(callEndDateTime)); 
 gc.add(Calendar.SECOND,-1 *持续时间); 
 callStartDateTime = simpleDateFormat.format(gc.getTime())  ; 
} catch(final ParseException parseException){
 LOGGER.error(“无法解析给定日期:” + callEndDateTime,parseException); 
 callStartDateTime = null; 
} 
   
 
 

感谢您的帮助!

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题