use of com.fasterxml.jackson.databind.util.ISO8601DateFormat in project JMRI by JMRI.
the class TrainCommon method getISO8601Date.
public static String getISO8601Date(boolean isModelYear) {
Calendar calendar = Calendar.getInstance();
// use the JMRI Timebase (which may be a fast clock).
calendar.setTime(jmri.InstanceManager.getDefault(jmri.Timebase.class).getTime());
if (isModelYear && !Setup.getYearModeled().isEmpty()) {
try {
calendar.set(Calendar.YEAR, Integer.parseInt(Setup.getYearModeled().trim()));
} catch (NumberFormatException e) {
return Setup.getYearModeled();
}
}
return (new ISO8601DateFormat()).format(calendar.getTime());
}
use of com.fasterxml.jackson.databind.util.ISO8601DateFormat in project verify-hub by alphagov.
the class SamlEngineApplication method run.
@Override
public final void run(SamlEngineConfiguration configuration, Environment environment) {
IdaSamlBootstrap.bootstrap();
environment.getObjectMapper().registerModule(new GuavaModule());
environment.getObjectMapper().setDateFormat(new ISO8601DateFormat());
// register resources
registerResources(environment, configuration);
// register exception mappers
environment.jersey().register(SamlEngineExceptionMapper.class);
environment.servlets().addFilter("Logging SessionId registration Filter", SessionIdQueryParamLoggingFilter.class).addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
}
use of com.fasterxml.jackson.databind.util.ISO8601DateFormat in project verify-hub by alphagov.
the class PolicyApplication method run.
@Override
public void run(PolicyConfiguration configuration, Environment environment) throws Exception {
environment.getObjectMapper().setDateFormat(new ISO8601DateFormat());
registerResources(configuration, environment);
registerExceptionMappers(environment);
environment.jersey().register(SessionIdPathParamLoggingFilter.class);
}
Aggregations