{"id":6805,"date":"2024-07-27T21:01:01","date_gmt":"2024-07-27T13:01:01","guid":{"rendered":""},"modified":"2024-07-27T21:01:01","modified_gmt":"2024-07-27T13:01:01","slug":"\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u6233_oracle\u83b7\u53d6\u65f6\u95f4\u6233","status":"publish","type":"post","link":"https:\/\/mushiming.com\/6805.html","title":{"rendered":"\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u6233_oracle\u83b7\u53d6\u65f6\u95f4\u6233"},"content":{"rendered":"
\n

\u6240\u8c13\u7b49\u5f85\uff0c\u4e0d\u8fc7\u53ea\u662f\u4e2a\u5ff5\u60f3\uff0c\u85cf\u5728\u5fc3\u91cc\u89c1\u4e0d\u5f97\u9633\u5149\uff0c\u50cf\u4e2a\u5438\u8840\u9b3c\u4e00\u6837\uff0c\u9192\u6765\u54ac\u4f60\u4e00\u53e3\uff0c\u8ba9\u4f60\u6b7b\u53bb\u6d3b\u6765\u7684\u75bc\u3002<\/p>\n<\/blockquote>\n


\n

\u8fd1\u65e5\u5728\u505a\u5f00\u53d1\u7684\u65f6\u5019\uff0c\u7528\u5230DatePicker\u63a7\u4ef6\uff0c\u9700\u8981\u5728\u540e\u53f0\u7528\u4ee3\u7801\u8bbe\u7f6eminDate\u548cmaxDate\u7684\u503c\uff0c\u7136\u540e\u53d1\u73b0\u9700\u8981\u4f20\u5165\u7684\u53c2\u6570\u662f\u4e00\u4e2aLong\u578b\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u65f6\u95f4\u6233\u683c\u5f0f\uff0c\u81ea\u6b64\u7b2c\u4e00\u6b21\u4e86\u89e3\u5230\u4e86\u65f6\u95f4\u6233\u7684\u6982\u5ff5\uff0c\u8fd8\u662f\u975e\u5e38\u597d\u7528\u7684\u3002<\/p>\n

\u65f6\u95f4\u6233\uff08timestamp\uff09\uff0c\u662f\u6307\u683c\u6797\u5a01\u6cbb\u65f6\u95f41970\u5e7401\u670801\u65e500\u65f600\u520600\u79d2(\u5317\u4eac\u65f6\u95f41970\u5e7401\u670801\u65e508\u65f600\u520600\u79d2)\u8d77\u81f3\u73b0\u5728\u7684\u603b\u79d2\u6570\u3002<\/em>\u901a\u4fd7\u7684\u8bb2\uff0c \u65f6\u95f4\u6233\u662f\u4e00\u4efd\u80fd\u591f\u8868\u793a\u4e00\u4efd\u6570\u636e\u5728\u4e00\u4e2a\u7279\u5b9a\u65f6\u95f4\u70b9\u5df2\u7ecf\u5b58\u5728\u7684\u5b8c\u6574\u7684\u53ef\u9a8c\u8bc1\u7684\u6570\u636e\u3002 \u5b83\u7684\u63d0\u51fa\u4e3b\u8981\u662f\u4e3a\u7528\u6237\u63d0\u4f9b\u4e00\u4efd\u7535\u5b50\u8bc1\u636e\uff0c \u4ee5\u8bc1\u660e\u7528\u6237\u7684\u67d0\u4e9b\u6570\u636e\u7684\u4ea7\u751f\u65f6\u95f4\u3002 \u5728\u5b9e\u9645\u5e94\u7528\u4e0a\uff0c \u5b83\u53ef\u4ee5\u4f7f\u7528\u5728\u5305\u62ec\u7535\u5b50\u5546\u52a1\u3001 \u91d1\u878d\u6d3b\u52a8\u7684\u5404\u4e2a\u65b9\u9762\uff0c \u5c24\u5176\u53ef\u4ee5\u7528\u6765\u652f\u6491\u516c\u5f00\u5bc6\u94a5\u57fa\u7840\u8bbe\u65bd\u7684 \u201c\u4e0d\u53ef\u5426\u8ba4\u201d \u670d\u52a1\u3002<\/strong><\/span><\/p>\n

1\u3001\u83b7\u53d6\u7cfb\u7edf\u65f6\u95f4<\/p>\n

\u65b9\u6cd5\u4e00 SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy\u5e74MM\u6708dd\u65e5 HH:mm:ss\");\/\/ HH:mm:ss \/\/\u83b7\u53d6\u5f53\u524d\u65f6\u95f4 Date date = new Date(System.currentTimeMillis());<\/code><\/pre>\n
\u65b9\u6cd5\u4e8c Calendar calendar = Calendar.getInstance(); \/\/\u83b7\u53d6\u7cfb\u7edf\u7684\u65e5\u671f \/\/\u5e74 int year = calendar.get(Calendar.YEAR); \/\/\u6708 int month = calendar.get(Calendar.MONTH)+1; \/\/\u65e5 int day = calendar.get(Calendar.DAY_OF_MONTH); \/\/\u83b7\u53d6\u7cfb\u7edf\u65f6\u95f4 \/\/\u5c0f\u65f6 int hour = calendar.get(Calendar.HOUR_OF_DAY); \/\/\u5206\u949f int minute = calendar.get(Calendar.MINUTE); \/\/\u79d2 int second = calendar.get(Calendar.SECOND);<\/code><\/pre>\n
\u65b9\u6cd5\u4e09 Time t=new Time(); \/\/ or Time t=new Time(\"GMT+8\"); \u52a0\u4e0aTime Zone\u8d44\u6599\u3002 t.setToNow(); \/\/ \u53d6\u5f97\u7cfb\u7edf\u65f6\u95f4\u3002 int year = t.year; int month = t.month+1; int day = t.monthDay; int hour = t.hour; \/\/ 0-23 int minute = t.minute; int second = t.second;<\/code><\/pre>\n

 2\u3001\u83b7\u53d6\u7cfb\u7edf\u65f6\u95f4\u6233<\/p>\n

public long getCurTimeLong(){ long time=System.currentTimeMillis(); return time; }<\/code><\/pre>\n

 3\u3001\u65f6\u95f4\u6233\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32<\/p>\n

public static String getDateToString(long milSecond, String pattern) { Date date = new Date(milSecond); SimpleDateFormat format = new SimpleDateFormat(pattern); return format.format(date); }<\/code><\/pre>\n

4\u3001\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65f6\u95f4\u6233<\/p>\n

public static long getStringToDate(String dateString, String pattern) { SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); Date date = new Date(); try{ date = dateFormat.parse(dateString); } catch(ParseException e) { \/\/ TODO Auto-generated catch block e.printStackTrace(); } return date.getTime(); }<\/code><\/pre>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u6233_oracle\u83b7\u53d6\u65f6\u95f4\u6233\u6240\u8c13\u7b49\u5f85\uff0c\u4e0d\u8fc7\u53ea\u662f\u4e2a\u5ff5\u60f3\uff0c\u85cf\u5728\u5fc3\u91cc\u89c1\u4e0d\u5f97\u9633\u5149\uff0c\u50cf\u4e2a\u5438\u8840\u9b3c\u4e00\u6837\uff0c\u9192\u6765\u54ac\u4f60\u4e00\u53e3\uff0c\u8ba9\u4f60...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/6805"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=6805"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/6805\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=6805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=6805"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=6805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}