我正在写一个项目,我想用goLang中的公历做一个日期变量,我已经搜索过它,但我没有找到答案 这里是我的想用java编写的golang中的代码golang上的公历日历包
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;
}
感谢帮助我!
顺便说看到documentation,麻烦'Calendar'类现在是传统的,由java.time类,如取代' ZonedDateTime'。 –