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)

태그목록

  • 직장의신
  • 시력검사
  • 독립운동
  • substr
  • pdf
  • 팝
  • 주차
  • spring+titles
  • html5
  • 달걀찜
  • 수면부족
  • 바코드
  • 비사
  • k9
  • 카라타 에리카
  • mybatis
  • 여성
  • CRC32
  • 대결
  • 날짜비교
  • 붕당정치
  • 잃은것
  • 전자정부프레임워크
  • Parkoz
  • 웃김
  • 아이폰6
  • 서비스
  • 메뉴바
  • RedirectAttributes
  • JSP

최근에 올라온 글

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

최근에 달린 댓글

  • <p align="center"><a href="h... 라임애드 02/14
  • <div style="OVERFLOW: hidden... 고사니 02/12
  • <p align="center"><a href="h... 라임정보 02/07
  • <p><img src="https://i.imgur... 브레드 01/22
  • <p><img src="https://i.imgur... 브레드 01/22

최근에 받은 트랙백

  • 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
  • similar site. similar site 01/06

글 보관함

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

달력

«   2021/03   »
일 월 화 수 목 금 토
  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 31      

링크

  • Total : 263572
  • Today : 29
  • Yesterday : 43
Tattertools
Eolin
rss

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