1、获取字符串格式日期的年月日 String propValue = "2007-12-31"; SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd"); Date modifyDate = formatter.parse(propValue); record.setDocYear(timestamp.getYear()+1900 ); record.setDocMonth(modifyDate.getMonth()+1); record.setDocDate(...
要将Oracle timestamp类型与字符串相互转换,可以使用TO_TIMESTAMP和TO_CHAR函数。 Oracle timestamp转换为字符串: SELECT TO_CHAR(timestamp_column, 'YYYY-MM-DD HH24:MI:SS') AS timestamp_string FROM your_table; 复制代码 字符串转换为Oracle timestamp: SELECT TO_TIMESTAMP('2022-01-01 12:00:00...