close

Trust Me!! Trust You!!


  • Blog
  • Local Log
  • Tag Cloud
  • Key Log
  • Guestbook
  • RSS Feed
  • Write a Post
  • Admin

혹시 블로그 스킨이 깨져 보이시나요? 최신버전의 Internet Explorer(Windows용), Opera, Firefox를 사용해보세요.

Found 1 article(s) for '날짜비교'.

  1. 2013/04/16 JSP 날짜비교

JSP 날짜비교

웹 프로그래밍
2013/04/16 18:14
 

<%@ page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"%>
<%@ page import="java.util.Calendar"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.DecimalFormat"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%!
public static String getdate(int mountdate){
   DecimalFormat df = new DecimalFormat("00");
   Calendar calendar = Calendar.getInstance();
   calendar.add(calendar.DATE, mountdate);
   String year = Integer.toString(calendar.get(Calendar.YEAR));
   String month = df.format(calendar.get(Calendar.MONTH) + 1);
   String day = df.format(calendar.get(Calendar.DATE));
   String date = year + "-" + month + "-" + day;
   return date;
}

public static int fnDateDiff(String stDate,String etDate){
 long d1,d2;
 Calendar c1 = Calendar.getInstance();
 Calendar c2 = Calendar.getInstance();
 String[] arr1 = stDate.split("-");
 String[] arr2 = etDate.split("-");
 c1.set(Integer.parseInt(arr1[0]),Integer.parseInt(arr1[1]),Integer.parseInt(arr1[2]));
 c2.set(Integer.parseInt(arr2[0]),Integer.parseInt(arr2[1]),Integer.parseInt(arr2[2]));
 d1 = c1.getTime().getTime();
 d2 = c2.getTime().getTime();

 int days =(int)((d2-d1)/(1000*60*60*24));
 return days;
}
%>
<%@ include file="socket.jsp" %>
<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires",0);
if (request.getProtocol().equals("HTTP/1.1")){
 response.setHeader("Cache-Control", "no-cache");
}

String sig_req_id = request.getParameter("sig_req_id");
Cookie[] cookies=request.getCookies();
String userDomain = "";
 
if(cookies !=null && cookies.length > 0){
 for(int i=0; i<cookies.length; i++){
  if( cookies[i].getName().equals("UD") ){
   userDomain = cookies[i].getValue();
  }
 }
}else{
 userDomain = "localhost";
}
String [] result = GetIsignData(sig_req_id,userDomain);
String nowDate = getdate(0);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="No-Cache">
</head>
<script type="text/javascript">
function init(){
 <% if( fnDateDiff(result[4],nowDate) >= 0 ){ %>
  parent.fnHndSingSocket('', '', '9999', '', '', '');  
 <% } else { %>
  parent.fnHndSingSocket('<%=result[0]%>', '<%=result[1]%>', '<%=result[2]%>', '<%=result[3]%>', '<%=result[4]%>', '<%=result[5]%>');
 <% } %>
}
init();
</script>
</html>

이올린에 북마크하기
TAG JSP, 날짜비교
No received trackback. / No comment.

Trackback Address :: http://viper150.cafe24.com/trackback/215

You can also say.

Prev 1 Next
블로그 이미지
이것저것 불펌금지도 퍼다가 담습니다. 외부에 비공개된 페이지 입니다. By. 어른왕자

카테고리

  • 전체 (298)
    • 사는 이야기 (115)
    • 웹 프로그래밍 (102)
    • App 프로그래밍 (22)
    • IT 뉴스&기타 (22)
    • 박한별 (4)
    • 역사&기타지식 (9)

태그목록

  • 성향
  • BrowserHelperObjects
  • 마우스
  • 착각
  • 지갑
  • 웃김
  • 잃은것
  • CGI
  • 바코드 이미지 생성
  • 수원
  • 허성도
  • Boy
  • C Left
  • 의자
  • pdf
  • 독립운동
  • PC일체형의자
  • Image Buttron
  • 화형
  • 붕당
  • 미국
  • 명언
  • mybatis
  • mysql
  • 달걀찜
  • 드릴
  • CD케이스
  • 피로
  • api doc
  • 여성

최근에 올라온 글

  • 보험사의 조정신청 대응방법.
  • 어느 천재의 앞선 시선.
  • [병맛더빙] 누구게..... (1)
  • 韓경제 `회색 코뿔소` 상황...
  • SVN Connector 설치 URL.
  • 군대를 가지 않는 서울대생.
  • “운은 하늘의 귀여움 받는...
  • 목장에서 알바하다가 캐스...
  • [펌]믿고 거르는 관상.
  • 하루에 1세트씩 하면 좋다...

최근에 달린 댓글

  • 대;한;민;국 초.대.남/스-와-... 소라 04/21
  • 여성흥분제팝니다 24시간 전... 정력제 04/18
  • 유벤투스의 스타 공격수, 크리... 호날두 04/18
  • 저도 칭구덕에 이젠 큰 부자가... 가현 04/15
  • 저도 칭구덕에 이젠 큰 부자가... 가현 04/12

최근에 받은 트랙백

  • Solace Salts Bold Tobacco. Solace Salts Bold Tobacco 03/29
  • read this post from Bookie 7. read this post from Bookie 7 02/28
  • công ty may đồng phục. công ty may đồng phục 01/08
  • Israelnightclub`s recent blo... Israelnightclub`s recent blo.. 01/06
  • Suggested Browsing. Suggested Browsing 01/06

글 보관함

  • 2019/03 (1)
  • 2018/12 (1)
  • 2018/09 (1)
  • 2018/08 (1)
  • 2018/02 (1)

달력

«   2021/04   »
일 월 화 수 목 금 토
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  

링크

  • Total : 266006
  • Today : 5
  • Yesterday : 65
Tattertools
Eolin
rss

어른왕자's blog is powered byTattertools1.1.2.2 : Animato