| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> oracle >> Oracle/JSP ji shu she ji ri qi he shi jian wen ti de chu li
 

Oracle/JSP ji shu she ji ri qi he shi jian wen ti de chu li

2008-08-15 05:14:53 编辑來源:互联网 评论
 
本文为【Oracle/JSP技术涉及日期和时间问题的处理】的拼音翻译版
  Oracle/JSP ji shu she ji ri qi 、 shi jian wen ti de chu li :
  (1) zai ying wen ban ben de ORACLE zhong mo ren ri qi ge shi wei 'DD-MON-YY', li ru '01-JAN-98'
  zai han hua de zhong wen ban ben zhong ORACLE mo ren ri qi ge shi wei ' ri - yue - nian ', li ru '21-8 yue -2003' huo '21-8 yue -03'
  (2) zhuan huan zi fu chuan wei ri qi
  shi yong ORACLE nei bu han shu to_date()
  to_date() han shu de shen shu shi to_char() han shu shen shu de fan zhuan 。
  to_date(string_value , date_format)
  bian liang ding yi ru xia :
  string_value : wei zi fu chuan zhi jie zhi ( zi fu chuan ben shen )、 zi fu chuan lie ( shu ju ku zhong ding yi de mou ge biao de mou lie ) huo mou zi fu chuan nei bu han shu de fan hui zhi 。
  date_format wei he fa de Oracle ri qi ge shi 。
  xia lie geng xin yu ju yun fu he ORACLE de ri qi ge shi , geng xin cheng gong :
  create table student (name varchar2(10) not null primary key , enrolldate date not null);// chuang jian student biao
  insert into student values('mark',to_date('08-21-2003','MM-DD-YYYY'));
  insert into student values('mark1',to_date('21-08-2003','DD-MM-YYYY'));
  insert into student values('mark2','21-8 yue -2003');
  insert into xiongxiaomin.student values('mark3','21-8 yue -03');
  (3) zhuan huan ri qi wei zi fu chuan
  shi yong ORACLE nei bu han shu to_char()
  to_char(date_value,date_format)
  bian liang ding yi ru xia :
  date_value : wei ri qi xing zhi jie zhi ( ri qi ben shen )、 ri qi xing lie zhi ( shu ju ku zhong ding yi de mou ge biao de mou lie ) huo mou nei bu han shu de fan hui de ri qi xing zhi 。
  date_format wei he fa de Oracle ri qi ge shi 。
  xuan ze enrolldate zi duan de shi jian bu fen :
  select (to_char(enrolldate,'HH24:MI:SS'))enrolldate from student;
  (4) zhu yi :ORACLE zhong de date shu ju lei xing ding yi de lie bao han ri qi he shi jian 。
  1、 xi tong dang qian ri qi wei 2003 nian 8 yue 21 ri , zhi hou zhi xing xia lie yu ju
  insert into student values('mark5',to_date('09:28:03','HH:MI:SS'));// zhu yi ci zhong zai yi tiao ji lu de date lei xing zi duan zhong cha ru shi jian de fang fa , xi tong mo ren de ri qi wei xi tong dang qian ri qi suo zai yue fen de di yi tian , yin ci de dao de ji lu wei
  Name enrolldate
  mark5 01- ba yue -2003 09:28:03 AM
  2、 xiu gai xi tong dang qian ri qi wei 2003 nian 7 yue 21 ri , zhi hou zhi xing xia lie yu ju
  insert into student values('mark6',to_date('09:28:03','HH:MI:SS'));
  de dao de ji lu wei
  Name enrolldate
  mark6 01- qi yue -2003 09:28:03 AM
  insert into student values('mark8',to_date('20:28:03','HH24:MI:SS'));
  3、 tong shi zai yi tiao ji lu zhong cha ru ri qi he shi jian de fang fa
  insert into student values('mark9',to_date('21-08-2003
  20:28:03','DD-MM-YYYY HH24:MI:SS'));// tong shi zai yi tiao ji lu zhong cha ru ri qi he shi jian de fang fa
  insert into student values('mark',to_date('21-08-2003
  09:52:03','DD-MM-YYYY HH:MI:SS'));// tong shi zai yi tiao ji lu zhong cha ru ri qi he shi jian de fang fa
  zhu yi bu neng shi yong xia lie fang fa tong shi cha ru ri qi he shi jian
  insert into student values('mark2','21-8 yue -2003'+to_date('
  09:52:03','HH:MI:SS'));// wu xiao cha ru ji lu fang fa
  4、 zai SQL*Plus Worksheet zhong zhi xing xia lie SQL yu ju
  select * from student;
  de dao de ji lu jie guo ru xia : zhu yi date lei xing zi duan zhong zhi xian shi le ri qi , shi jian bing wei xian shi
  NAME ENROLLDATE
  mark 18-8 yue -03
  mark1 21-8 yue -03
  mark2 21-8 yue -03
  
  yi xuan ze 3 xing 。
  
  5、 dan zai JSP cheng xu zhong tong yang zhi xing select * from student order by enrolldate
  xian shi jie guo jian xia tu ( ji xian shi le ri qi , you xian shi le shi jian )
  JSP ye mian zhong de xian shi jie guo
  6、 zai SQL*Plus Worksheet zhong zhi xing xia lie SQL yu ju
  select name,to_char(enrolldate,'DD-MM-YYYY HH:MI:SS') from student;
  de dao de ji lu jie guo ru xia : zhu yi date lei xing zi duan zhong xian shi le ri qi he shi jian
  NAME TO_CHAR(ENROLLDATE,'DD-MM-YYYYHH:MI:SS
  mark 21-08-2003 12:00:00
  mark1 21-08-2003 12:00:00
  yi xuan ze 2 xing
  zhu yi :5 he 6 zhong de bu tong , shi jian dao miao shi ,JSP ye mian zhong xian shi shi duo chu le ". 0"
  7、 zai SQL*Plus Worksheet zhong zhi xing xia lie SQL yu ju
  select name,to_char(enrolldate,'DD-MM-YYYY HH24:MI:SS') from student;
  de dao de ji lu jie guo ru xia : zhu yi date lei xing zi duan zhong xian shi le ri qi , shi jian
  NAME TO_CHAR(ENROLLDATE,'DD-MM-YYYYHH24:MI:
  mark 18-08-2003 17:40:20
  mark1 21-08-2003 00:00:00
  mark2 21-08-2003 00:00:00
  yi xuan ze 3 xing 。
  zhu yi :6 he 7 zhong de SELECT zhong de "HH:MI:SS" he "HH24:MI:SS" liang zhe de bu tong shi "HH" wei xiao shi zhi , zhi de fan wei wei 0-12;"HH24" wei 24 xiao shi zhi , zhi de fan wei wei 0-23。
  kan xia lie li zi :
  ①insert into student values(' nan tai li ',to_date('08-19-2003
  13:54:05','MM-DD-YYYY HH24:MI:SS'));
  ORACLE zhong de ji lu jie guo wei :
  NAME enrolldate
  nan tai li 19- ba yue -2003 01:54:05 PM
  ②insert into student values(' nan tai li 2',to_date('08-19-2003
  13:54:05','MM-DD-YYYY HH:MI:SS'));// cha ru cuo wu
  cuo wu ti shi wei :
  insert into student values(' nan tai li 2',to_date('08-19-2003 13:54:05','MM-DD
  *
  ERROR wei yu di 1 xing :
  ORA-01849: xiao shi zhi bi xu jie yu 1 he 12 zhi jian
  ji ying yong "HH" shi , bu neng ying yong "13:54:05", er ying gai wei "01:54:05"
  zheng que yu ju ru xia :
  insert into student values(' nan tai li 2',to_date('08-19-2003
  01:54:05','MM-DD-YYYY HH:MI:SS'));
  ORACLE zhong de ji lu jie guo wei :
  NAME enrolldate
  nan tai li 2 19- ba yue -2003 01:54:05 AM
  zhu yi shang shu liang zhong fang shi de chu de jie guo yi zhong wei PM, ling yi zhong wei AM。
  wei le ti gao zheng que xing , jian yi dou shi yong di yi zhong fang shi "HH24"
  8、 dan zai JSP cheng xu zhong tong yang zhi xing select name,to_char(enrolldate,'DD-MM-YYYY HH:MI:SS') from student
  xian shi jie guo jian xia tu 。( qi jie guo yu zai SQL*Plus Worksheet zhong zhi xing xia lie SQL yu ju
  select name,to_char(enrolldate,'DD-MM-YYYY HH:MI:SS') from student; xiang tong )
  9、 zai SQL*Plus Worksheet zhong zhi xing xia lie SQL yu ju
  select name,to_char(enrolldate,'month dd,yyyy HH24:MI:SS') from student;
  de dao de ji lu jie guo ru xia : zhu yi date lei xing zi duan zhong xian shi le ri qi , shi jian
  NAME TO_CHAR(ENROLLDATE,'MONTHDD,YYYYHH24:MI:SS')
  mark 8 yue 18,2003 17:40:20
  mark1 8 yue 21,2003 00:00:00
  mark2 8 yue 21,2003 00:00:00
  yi xuan ze 3 xing 。
  10、to_char() han shu ,'DD-MM-YYYY' ge shi ji 'MM-DD-YYYY' ge shi he 'month dd,yyyy' ge shi de bu tong
  'DD-MM-YYYY' ge shi :21-08-2003
  'month dd,yyyy' ge shi :8 yue 21,2003
  11、 zhu yi : zai ri qi he shi jian ge shi zhong fei chang rong yi hun xiao de shi yue fen he miao de ge shi ( ji MM he MI)
  zai SQLPlus*Worksheet zhong zhi xing xia lie yu ju , bu bao cuo 。
  insert into student values(' wang jia ',to_date('08:05','HH24:MM'));//08 bei ren wei shi xiao shi ,05 bei ren wei shi yue fen 。
  commit;
  zai biao bian ji qi zhong cha kan : shi ji cha ru zhi wei
  NAME ENROLLDATE
  wang jia 01- wu yue -2003 08:00:00 AM
  select name,to_char(enrolldate,'DD-MM-YYYY HH24:MI:SS')enrolldate from
  student where name=' wang jia ';
  NAME ENROLLDATE
  wang jia 01-05-2003 08:00:00
  yi xuan ze 1 xing 。
  insert into student values(' wang jia 2',to_date('08-19-2003
  13:54:05','MM-DD-YYYY HH24:MI:SS'));
  12、 shi yong Oracle de date shu ju lei xing de ling yi ge you dian shi : ta zhi chi ri qi de yun suan 。 ke yi dui yi jing cun zai de
  ri qi jia shang huo jian qu ruo gan tian , li ru :
  insert into student values(' xiong ',sysdate+7);【原文】【汉音对照
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
Oracle/JSP ji shu she ji ri qi 、 shi jian wen ti de chu li : (1) zai ying wen ban ben de ORACLE zhong mo ren ri qi ge shi wei 'DD-MON-YY', li ru '01-JAN-98' zai han hua de zhong wen ban ben zhong ORACLE mo ren ri qi ge shi wei ' ri - yue - nian ', li ru '21-8 yue -2003' huo '21-8 yue -03' (2) zhuan huan zi fu chuan wei ri qi shi yong ORACLE nei bu han shu to_date() to_date() han shu de shen shu shi to_char() han shu shen shu de fan zhuan 。 to_date(string_value , date_format) bian liang ding yi ru xia : string_value : wei zi fu chuan zhi jie zhi ( zi fu chuan ben shen )、 zi fu chuan lie ( shu ju ku zhong ding yi de mou ge biao de mou lie ) huo mou zi fu chuan nei bu han shu de fan hui zhi 。 date_format wei he fa de Oracle ri qi ge shi 。 xia lie geng xin yu ju yun fu he ORACLE de ri qi ge shi , geng xin cheng gong : create table student (name varchar2(10) not null primary key , enrolldate date not null);// chuang jian student biao insert into student values('mark',to_date('08-21-2003','MM-DD-YYYY')); insert into student values('mark1',to_date('21-08-2003','DD-MM-YYYY')); insert into student values('mark2','21-8 yue -2003'); insert into xiongxiaomin.student values('mark3','21-8 yue -03'); (3) zhuan huan ri qi wei zi fu chuan shi yong ORACLE nei bu han shu to_char() to_char(date_value,date_format) bian liang ding yi ru xia : date_value : wei ri qi xing zhi jie zhi ( ri qi ben shen )、 ri qi xing lie zhi ( shu ju ku zhong ding yi de mou ge biao de mou lie ) huo mou nei bu han shu de fan hui de ri qi xing zhi 。 date_format wei he fa de Oracle ri qi ge shi 。 xuan ze enrolldate zi duan de shi jian bu fen : select (to_char(enrolldate,'HH24:MI:SS'))enrolldate from student; (4) zhu yi :ORACLE zhong de date shu ju lei xing ding yi de lie bao han ri qi he shi jian 。 1、 xi tong dang qian ri qi wei 2003 nian 8 yue 21 ri , zhi hou zhi xing xia lie yu ju insert into student values('mark5',to_date('09:28:03','HH:MI:SS'));// zhu yi ci zhong zai yi tiao ji lu de date lei xing zi duan zhong cha ru shi jian de fang fa , xi tong mo ren de ri qi wei xi tong dang qian ri qi suo zai yue fen de di yi tian , yin ci de dao de ji lu wei Name enrolldate mark5 01- ba yue -2003 09:28:03 AM 2、 xiu gai xi tong dang qian ri qi wei 2003 nian 7 yue 21 ri , zhi hou zhi xing xia lie yu ju insert into student values('mark6',to_date('09:28:03','HH:MI:SS')); de dao de ji lu wei Name enrolldate mark6 01- qi yue -2003 09:28:03 AM insert into student values('mark8',to_date('20:28:03','HH24:MI:SS')); 3、 tong shi zai yi tiao ji lu zhong cha ru ri qi he shi jian de fang fa insert into student values('mark9',to_date('21-08-2003 20:28:03','DD-MM-YYYY HH24:MI:SS'));// tong shi zai yi tiao ji lu zhong cha ru ri qi he shi jian de fang fa insert into student values('mark',to_date('21-08-2003 09:52:03','DD-MM-YYYY HH:MI:SS'));// tong shi zai yi tiao ji lu zhong cha ru ri qi he shi jian de fang fa zhu yi bu neng shi yong xia lie fang fa tong shi cha ru ri qi he shi jian insert into student values('mark2','21-8 yue -2003'+to_date(' 09:52:03','HH:MI:SS'));// wu xiao cha ru ji lu fang fa 4、 zai SQL*Plus Worksheet zhong zhi xing xia lie SQL yu ju select * from student; de dao de ji lu jie guo ru xia : zhu yi date lei xing zi duan zhong zhi xian shi le ri qi , shi jian bing wei xian shi NAME ENROLLDATE mark 18-8 yue -03 mark1 21-8 yue -03 mark2 21-8 yue -03 yi xuan ze 3 xing 。 5、 dan zai JSP cheng xu zhong tong yang zhi xing select * from student order by enrolldate xian shi jie guo jian xia tu ( ji xian shi le ri qi , you xian shi le shi jian ) JSP ye mian zhong de xian shi jie guo 6、 zai SQL*Plus Worksheet zhong zhi xing xia lie SQL yu ju select name,to_char(enrolldate,'DD-MM-YYYY HH:MI:SS') from student; de dao de ji lu jie guo ru xia : zhu yi date lei xing zi duan zhong xian shi le ri qi he shi jian NAME TO_CHAR(ENROLLDATE,'DD-MM-YYYYHH:MI:SS mark 21-08-2003 12:00:00 mark1 21-08-2003 12:00:00 yi xuan ze 2 xing zhu yi :5 he 6 zhong de bu tong , shi jian dao miao shi ,JSP ye mian zhong xian shi shi duo chu le ". 0" 7、 zai SQL*Plus Worksheet zhong zhi xing xia lie SQL yu ju select name,to_char(enrolldate,'DD-MM-YYYY HH24:MI:SS') from student; de dao de ji lu jie guo ru xia : zhu yi date lei xing zi duan zhong xian shi le ri qi , shi jian NAME TO_CHAR(ENROLLDATE,'DD-MM-YYYYHH24:MI: mark 18-08-2003 17:40:20 mark1 21-08-2003 00:00:00 mark2 21-08-2003 00:00:00 yi xuan ze 3 xing 。 zhu yi :6 he 7 zhong de SELECT zhong de "HH:MI:SS" he "HH24:MI:SS" liang zhe de bu tong shi "HH" wei xiao shi zhi , zhi de fan wei wei 0-12;"HH24" wei 24 xiao shi zhi , zhi de fan wei wei 0-23。 kan xia lie li zi : ①insert into student values(' nan tai li ',to_date('08-19-2003 13:54:05','MM-DD-YYYY HH24:MI:SS')); ORACLE zhong de ji lu jie guo wei : NAME enrolldate nan tai li 19- ba yue -2003 01:54:05 PM ②insert into student values(' nan tai li 2',to_date('08-19-2003 13:54:05','MM-DD-YYYY HH:MI:SS'));// cha ru cuo wu cuo wu ti shi wei : insert into student values(' nan tai li 2',to_date('08-19-2003 13:54:05','MM-DD * ERROR wei yu di 1 xing : ORA-01849: xiao shi zhi bi xu jie yu 1 he 12 zhi jian ji ying yong "HH" shi , bu neng ying yong "13:54:05", er ying gai wei "01:54:05" zheng que yu ju ru xia : insert into student values(' nan tai li 2',to_date('08-19-2003 01:54:05','MM-DD-YYYY HH:MI:SS')); ORACLE zhong de ji lu jie guo wei : NAME enrolldate nan tai li 2 19- ba yue -2003 01:54:05 AM zhu yi shang shu liang zhong fang shi de chu de jie guo yi zhong wei PM, ling yi zhong wei AM。 wei le ti gao zheng que xing , jian yi dou shi yong di yi zhong fang shi "HH24" 8、 dan zai JSP cheng xu zhong tong yang zhi xing select name,to_char(enrolldate,'DD-MM-YYYY HH:MI:SS') from student xian shi jie guo jian xia tu 。( qi jie guo yu zai SQL*Plus Worksheet zhong zhi xing xia lie SQL yu ju select name,to_char(enrolldate,'DD-MM-YYYY HH:MI:SS') from student; xiang tong ) 9、 zai SQL*Plus Worksheet zhong zhi xing xia lie SQL yu ju select name,to_char(enrolldate,'month dd,yyyy HH24:MI:SS') from student; de dao de ji lu jie guo ru xia : zhu yi date lei xing zi duan zhong xian shi le ri qi , shi jian NAME TO_CHAR(ENROLLDATE,'MONTHDD,YYYYHH24:MI:SS') mark 8 yue 18,2003 17:40:20 mark1 8 yue 21,2003 00:00:00 mark2 8 yue 21,2003 00:00:00 yi xuan ze 3 xing 。 10、to_char() han shu ,'DD-MM-YYYY' ge shi ji 'MM-DD-YYYY' ge shi he 'month dd,yyyy' ge shi de bu tong 'DD-MM-YYYY' ge shi :21-08-2003 'month dd,yyyy' ge shi :8 yue 21,2003 11、 zhu yi : zai ri qi he shi jian ge shi zhong fei chang rong yi hun xiao de shi yue fen he miao de ge shi ( ji MM he MI) zai SQLPlus*Worksheet zhong zhi xing xia lie yu ju , bu bao cuo 。 insert into student values(' wang jia ',to_date('08:05','HH24:MM'));//08 bei ren wei shi xiao shi ,05 bei ren wei shi yue fen 。 commit; zai biao bian ji qi zhong cha kan : shi ji cha ru zhi wei NAME ENROLLDATE wang jia 01- wu yue -2003 08:00:00 AM select name,to_char(enrolldate,'DD-MM-YYYY HH24:MI:SS')enrolldate from student where name=' wang jia '; NAME ENROLLDATE wang jia 01-05-2003 08:00:00 yi xuan ze 1 xing 。 insert into student values(' wang jia 2',to_date('08-19-2003 13:54:05','MM-DD-YYYY HH24:MI:SS')); 12、 shi yong Oracle de date shu ju lei xing de ling yi ge you dian shi : ta zhi chi ri qi de yun suan 。 ke yi dui yi jing cun zai de ri qi jia shang huo jian qu ruo gan tian , li ru : insert into student values(' xiong ',sysdate+7);
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
时尚性感的燕子(3)
时尚性感的燕子(2)
纯美的女生生活写真(14)
纯美的女生生活写真(13)
来自束河[]
恰巧-巧家~~
高尔夫
行摄匆匆天子山
 
>>返回首页<<
 为你推荐
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
©2005- 王朝网络 版权所有