JAVA和Oracle中如何格式化日期

xiaoxiao2021-03-01  6

JAVA: SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH(hh)-mm-ss");String b = df.format(new Date());System.out.println(b); 输出: [color=red]2008-12-26 17(05)-48-54[/color] 注意看大小写! Oracle: select to_date('2008-12-26 15:16:17','yyyy-mm-dd [color=red]hh24[/color]:mi:ss') from dual; 输出:2008-12-26 15:16:17 select to_date('2008-12-26 10:16:17','yyyy-mm-dd hh:mi:ss') from dual; 输出:2008-12-26 10:16:17
转载请注明原文地址: https://www.6miu.com/read-3849972.html

最新回复(0)