public static String getDateTimeFormat() { final ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.instance().getIfDefined(); if (db != null && !db.isClosed()) return db.getStorage().getConfiguration().getDateTimeFormat(); else return DEF_DATETIME_FORMAT; }
} catch (ParseException pe) { final String dateFormat = ((String) iValue).length() > config.getDateFormat().length() ? config.getDateTimeFormat() : config.getDateFormat(); throw OException.wrapException( new OQueryParsingException("Error on conversion of date '" + iValue + "' using the format: " + dateFormat), pe);
resultSet.add(new ODocument().field("NAME", "Conflict-Strategy").field("VALUE", dbCfg.getConflictStrategy())); resultSet.add(new ODocument().field("NAME", "Date-Format").field("VALUE", dbCfg.getDateFormat())); resultSet.add(new ODocument().field("NAME", "Datetime-Format").field("VALUE", dbCfg.getDateTimeFormat())); resultSet.add(new ODocument().field("NAME", "Timezone").field("VALUE", dbCfg.getTimeZone().getID())); resultSet.add(new ODocument().field("NAME", "Locale-Country").field("VALUE", dbCfg.getLocaleCountry()));
private Object toResult(OStorageConfiguration configuration) { OResultInternal result = new OResultInternal(); result.setProperty("charset", configuration.getCharset()); result.setProperty("clusterSelection", configuration.getClusterSelection()); result.setProperty("conflictStrategy", configuration.getConflictStrategy()); result.setProperty("dateFormat", configuration.getDateFormat()); result.setProperty("dateTimeFormat", configuration.getDateTimeFormat()); result.setProperty("localeCountry", configuration.getLocaleCountry()); result.setProperty("localeLanguage", configuration.getLocaleLanguage()); result.setProperty("recordSerializer", configuration.getRecordSerializer()); result.setProperty("timezone", String.valueOf(configuration.getTimeZone())); result.setProperty("properties", toResult(configuration.getProperties())); return result; }
return storage.getConfiguration().getDateTimeFormat();