1970년 이전 날짜에대해서는 date와 mktime 으로 값을 구할수가 없기에 찾아봤더니..1902년 부터인가를 구하는 프로그램이 있더군요..
그래서 그냥 1년 부터 구하도록 만들었습니다.
근데 문제는. 1년부터 1582년 10월 14일 까지는.. 가상의 날짜입니다.
현재 사용되는 달력은 1582년 10월 15일부터 고정되었다고 하더군요..

함수는. new_date와 new_mktime 이며 사용법은 같습니다.
그리고 아직 미완성이기 때문에.. 주로 사용되는 포맷만 구현되어있습니다 ^^;;
거기에 하나더 미완성인게.. new_mktime 의 인자값으로 음수가 들어갈경우는 처리가 되어있지 않습니다.. 지금 작업할게 있어서요 ㅋ
아래 내용을 복사해서 라이브러리에 넣어두고 사용하시면됩니다.
버그나 수정사항은 직접고치셨다면 여기에 올려주시면 감사하겠습니다. (__)
(902년 부터 뽑아주는 함수를 조금 참고했습니다.)

<?
/*
+---------------------------------------------------------------------+
| Copyleft (L) 2005.1.9 by NiL |
+---------------------------------------------------------------------+
| 본 프로그램은 제작자와는 전혀 무관하게 맘대로 복사, 수정, 파손 |
| 또는, 대여, 판매할수 있습니다. |
| 수정된 소스는 제작자와 많은 사람들과 공유되기를 원합니다. |
+---------------------------------------------------------------------+
| Author: Park J. NiL <nils@jnils.net> |
+---------------------------------------------------------------------+
*/

function is_leaf_year($y) {
    if(($y % 400) == 0) return true;
    else if(($y % 100) == 0) return false;
    else if(($y % 4) == 0) return true;
    else return false;
}

function new_mktime($hour, $min, $sec, $month, $day, $year) {
    $hour = intval($hour);
    $min = intval($min);
    $sec = intval($sec);
    $month = intval($month);
    $day = intval($day);
    $year = intval($year);

    $month_arr[0] = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    $month_arr[1] = array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

    $_days = 0;
    $_secs = 0;

    $normal_year_days = 365;
    $leaf_year_days = 366;

    $_day_sec = 86400;
    $_hour_sec = 3600;
    $_min_sec = 60;

    $_day_min = 1440;
    $_hour_min = 60;

    $_day_hour = 24;

    $_timestamp = 0;

    // 초 더하기
    $secs = $sec;
   
    // 분을 초로
    $secs += $min * $_min_sec;

    // 시를 초로
    $secs += $hour * $_hour_sec;

    // 날 더하기
    $days = $day;
   
    // 월을 날짜로
    $_year_cnt = floor(($month - 1) / 12);
    $month = $month % 12;
    for($i = 0; $i < $month - 1; $i++)
    {
        $_month = ($i % 12) + 1;
        $leaf_flg = 0; // 기본값으로 윤달 아님

        if($_month == 2) // 2월이면 윤달 체크
        {
            if(is_leaf_year($year + $_year_cnt)) $leaf_flg = 1;
            else $leaf_flg = 0;
        }
        $days += $month_arr[$leaf_flg][$i];
    }

    // 년을 날짜로
    $year += $_year_cnt;
    for($i = 1; $i < $year; $i++)
    {
        $_year = $i;
        $days += is_leaf_year($_year) ? $leaf_year_days : $normal_year_days;
    }

    $_timestamp = ($days * $_day_sec) + $secs;
    return $_timestamp;
}

function get_days(&$t)
{
    $day_sec = 86400;
    $days = floor($t / $day_sec);
    $t = $t - (floor($t / $day_sec) * $day_sec);
    return $days;
}

function get_date($d)
{
    $leaf_year_days = 366;
    $normal_year_days = 365;
   
    $month_arr[0] = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    $month_arr[1] = array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    $year = 0;
    $month = 0;
    $day = 0;

    $flg = true;
    while($flg)
    {
        $year++;
        if(is_leaf_year($year))
        {
            if($d > $leaf_year_days) $d -= $leaf_year_days;
            else $flg = false;
            $leaf_flg = 1;
        }
        else
        {
            if($d > $normal_year_days) $d -= $normal_year_days;
            else $flg = false;
            $leaf_flg = 0;
        }
    }

    $month_cnt = 0;
    while($d > $month_arr[$leaf_flg][$month_cnt])
    {
        $d -= $month_arr[$leaf_flg][$month_cnt];
        $month_cnt++;
    }
    $month = $month_cnt + 1;
    $day = $d;
    return sprintf("%04d%02d%02d", $year, $month, $day);
}

function get_time($t)
{
    $hour_sec = 3600;
    $min_sec = 60;

    $hour = floor($t / $hour_sec);
    $min = floor(($t % $hour_sec) / $min_sec);
    $sec = $t % $min_sec;

    return sprintf("%02d%02d%02d", $hour, $min, $sec);
}

function cal_date($t)
{
    if($t == "")
    {
        return date("YmdHis");
    }
    else
    {
        $days = get_days(&$t);
        $date = get_date($days);
        $time = get_time($t);
        return $date.$time;
    }
}

function new_date()
{
    if(func_num_args() != 1 && func_num_args() != 2) return false;
    $format = func_get_arg(0);
    $timestamp = func_get_arg(1);
    $date = cal_date($timestamp);

    $year = substr($date, 0, 4);
    $month = substr($date, 4, 2);
    $day = substr($date, 6, 2);
    $hour = substr($date, 8, 2);
    $min = substr($date, 10, 2);
    $sec = substr($date, 12, 2);

    $out_buf = "";
    for($i = 0; $i < strlen($format); $i++)
    {
        $c = substr($format, $i, 1);
        switch ($c)
        {
            case "a":
                $out_buf .= $hour < 12 ? "am" : "pm";
                break;
            case "A":
                $out_buf .= $hour < 12 ? "AM" : "PM";
                break;
            case "B":
                break;
            case "c":
                break;
            case "d":
                $out_buf .= sprintf("%02d", $day);
                break;
            case "D":
                break;
            case "F":
                break;
            case "g":
                $out_buf .= sprintf("%d", (($hour - 1) % 12) + 1);
                break;
            case "G":
                $out_buf .= sprintf("%d", $hour);
                break;
            case "h":
                $out_buf .= sprintf("%02d", (($hour - 1) % 12) + 1);
                break;
            case "H":
                $out_buf .= sprintf("%02d", $hour);
                break;
            case "i":
                $out_buf .= sprintf("%02d", $min);
                break;
            case "I":
                break;
            case "j":
                $out_buf .= sprintf("%d", $day);
                break;
            case "l":
                break;
            case "L":
                break;
            case "m":
                $out_buf .= sprintf("%02d", $month);
                break;
            case "M":
                break;
            case "n":
                $out_buf .= sprintf("%d", $month);
                break;
            case "O":
                break;
            case "r":
                break;
            case "s":
                $out_buf .= sprintf("%02d", $sec);
                break;
            case "S":
                break;
            case "t":
                break;
            case "T":
                break;
            case "U":
                break;
            case "w":
                break;
            case "W":
                break;
            case "Y":
                $out_buf .= sprintf("%04d", $year);
                break;
            case "y":
                $out_buf .= substr(sprintf("%04d", $year), 2, 2);
                break;
            case "z":
                break;
            case "Z":
                break;
            default :
                $out_buf .= $c;
        }
    }
    return $out_buf;
}
?>

사용법 예제입니다.
[jnils@hosting1 typhoon]$ cat ./test.php
#!/usr/local/bin/php
<?
include \"lib.php\";
echo date(\"YmdHis\", mktime(71, 71, 71, 15, 445, 1999)).\"\\n\";
echo new_date(\"YmdHis\", new_mktime(71, 71, 71, 15, 445, 1999)).\"\\n\";
?>
[jnils@hosting1 typhoon]$ ./test.php
20010522001211
20010522001211


http://www.phpschool.com/bbs2/inc_view.html?id=11707&code=tnt2&start=0&mode=search&field=title&search_name=&operator=and&period=last1year&category_id=&s_que=19
Posted by 알 수 없는 사용자
,
php 에서의 날짜관련함수 및 계산방법입니다.

출력.
mktime(시,분,초,월,일,년) 유닉스 타임(타임스탬프:1970년을기준으로부터 1초단위숫자)으로 값을 출력합니다.
타임스탬프를 날짜형식으로 볼수 있는 함수가 date 입니다.
http://man.phpschool.com/manual/kr/function.date.phpdate : 함수레퍼런스
date는 날짜가 들어가지 않으면 기본적으로 오늘을 뜻합니다.
date("Y-m-d") ==> 오늘 날짜
mktime 으로 얻은 값을 date 함수로 특정 형식으로 출력
date("Y-m-d", mktime(0, 0, 0, 12, 32, 1997)); ==> 1998-01-01

출력의 할때 편리한 점은 1월32일은 2월1 일로 나온다는 것입니다.
그럼 2005년 1월부터 100일 지난 날은 몇일일까요?
응용 date("Y-m-d", mktime(0, 0, 0, 0 , 1, 101, 2005)); ==> 2005년 04월 11일
(1월1일은 포함하면 안되겠죠? 그래서 하루 더 증가~)
출력의 기본입니다.

계산.
기본연산은 strtotime("각종연산") 으로 합니다.
타임스탬프를 리턴합니다.
이말은 date 형으로 출력할 수 있다는 말입니다. ^^
http://man.phpschool.com/manual/kr/function.strtotime.php" :strtotime 함수레퍼런스

strtotime 은 날짜가 들어가지 않으면 기본적으로 오늘을 뜻합니다.
그리고 이 함수 또한 일수가 넘어가면 다음달로 계산됩니다.
strtotime("+3 day") => 오늘에서 3일 후, 물론 달이 넘어가면 1일로 계산됨
이 함수를 개인적으로 좋아하는 이유가 mktime 을 사용할 필요가 없다는 점입니다.
(필요가 있을 경우를 찾아주세요. ㅡ_-+)

date("Y년 m월 d일 h:m:s",mktime(12,12,1,1,2,2005))
date("Y년 m월 d일 h:m:s",strtotime("2005-01-02 12:12:01"))

이 두 함수는 같은 2005년 01월 02일 12:01:01 을 나타냅니다.
물론 사용하기도 strtotime 이 훨씬 쉽습니다.

그럼 2005년 1월부터 100일 지난 날은 몇일인지 strtotime 을 이용해서 확인해봅시다.
응용 date("Y-m-d", strtotime("2005-01-01 +100 day")); ==> 2005년 04월 11일
위에서
+100 day 는 +2 month 나 +10 year 와 같이 특정 연산이 가능합니다.
그래서 더욱 멋지게 보입니다. ㅡ_-+

두날짜의 연산은 타임스탬프로 두날짜의 차이값을 얻어서 86400 (60초*60분*24시) 로 나누면 몇일인지 나옵니다.
intval((strtotime("2005-01-10")-strtotime("2005-01-02"))/86400)    =>    8

이만하면 PHP 에서 웬만한 날짜 계산을 하실 수 있습니다.




참고용.
PHP의 경우는 strtotime 함수로 해결
http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=38930

ASP의 경우는 DateAdd 함수를 이용한 방법
http://www.taeyo.pe.kr/lecture/2_beginner_hwang/4_2.htm

MySQL 은 [본문]과 내용에 대한 메뉴얼..
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html

MsSQL 도 ASP와 마찬가지로 DateAdd 로 처리가능
http://msdn2.microsoft.com/en-us/library/aa258863(SQL.80).aspx
Posted by 알 수 없는 사용자
,

timestamp 로 받은 값을 원하는 date형식으로 보여주는 겁니다.
아주 간단하므로, 원하시는대로 살을붙여서 사용하시면 됩니다.
샘플로 월을 영어로 표기하도록 해봤습니다.


소스코드

var DateFormatter = {
    month : ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
    parse : function(timestamp, format) {
        var timestamp = parseInt(timestamp);
        if(timestamp < 10000000000) timestamp *= 1000;

        _date = new Date();
        _date.setTime(timestamp);

        var year = _date.getFullYear();
        var month = this.month[_date.getMonth()];
        var day = _date.getDate();

        var hour = _date.getHours();
        var min = _date.getMinutes();
        var sec = _date.getSeconds();

        if(format){
            format = format.replace(/y/i, year);
            format = format.replace(/m/i, month);
            format = format.replace(/d/i, day);
            format = format.replace(/h/i, hour);
            format = format.replace(/i/i, min);
            format = format.replace(/s/i, sec);

            return format;
        }
        else{
            return day + " " + month + " " + year;
        }
    }
};


사용예제

var timestamp = new Date().getTime();
alert(DateFormatter.parse(timestamp));
alert(DateFormatter.parse(timestamp, 'd m y h:i:s'));


 

PHP : http://oxtag.com/php/p/timestamp_change.php
JS : http://oxtag.com/zboard/zboard.php?id=js&no=741
Posted by 알 수 없는 사용자
,

구구단 :

http://oxtag.com/php/p/99dan.php



기념일 계산 날짜 계산 및 음력, 양력
http://oxtag.com/php/p/Date/Date.php



디데이(D-DAY) 카운터 사용법 :
http://oxtag.com/php/p/Date/D-DAY/user.php



기념일 카운터 사용법 :
http://oxtag.com/php/p/Date/D-DAY/user2.php



기념일 계산,날자 계산,날짜 계산,음력 변환,양력 변환,
음양력 변환,윤달,요일 계산,남은 날짜,요일계산,며칠째,몇일째
http://oxtag.com/php/p/calendar2.php



타임스템프(Timestamp) 계산기
http://oxtag.com/php/p/timestamp_change.php
Timestamp - Date Manager
타임스템프(Timestamp) 계산기



도량형 환산표, 단위 환산, 면적 구하는 공식, 면적단위
http://oxtag.com/php/p/DoRyangHyung/
도량형 환산표, 단위 환산, 면적 구하는 공식, 면적단위



세금계산서 : 부가세포함, 부가세별도, 부가세 미포함 계산기
http://oxtag.com/php/p/tax_bill.php
세금계산서 : 부가세포함, 부가세별도, 부가세 미포함 계산기



단기,서기,육십갑자,띠 조회
http://oxtag.com/php/p/yuksipgapja.php
단기,서기,육십갑자(六十甲子),육십간지(六十干支),
십간십이지 (十干十二支),십이지신,십이간지,십이지,십이지신,십간,띠,十二辰



로또(LOTTO) 추첨기 대박나세요.
http://oxtag.com/php/p/lotto/lotto2.php



태그연습장, 웹소스보기
태그연습장 및 웹소스보기 입니다.
http://oxtag.com/html/ex/CTediter/CTediter.html



온라인 타자연습기, 웹타자연습, 타이핑연습,
웹 타자연습, 영타연습, 영문타자, 한타, 영타
온라인 타자 연습기 입니다.
온라인 타자 연습, 웹 타자연습기, 타이핑, 영타연습, 영문타자, 한타, 영타
http://oxtag.com/php/taja/taja.html




택배조회 배송조회 배송추적 배송검색 택배추적
택배조회,추적,택배검색,배송조회:호남택배,KBG택배,KGB특급,CJGLS,로젠,한진,우체국,삼성HTH,대한통운,옐로우캡,트라넷택배,현대택배,훼미리택배,고려택배,이클라인(ECLINE),아주,KT로지스,양양택배,일양택배,DHL,Fedex,UPS,EMS,경동택배,하나로택배,하나로로지스,천일화물택배
http://oxtag.com/html/ex/DoorToDoor/




경동택배 전국 영업소 전화번호 및 택배조회, 배송조회, 배송추적
경동택배 전국 영업소 전화번호 및 택배조회, 배송조회, 배송추적
http://oxtag.com/php/kdexp/



webime, web ime, web hangul ime, korea ime, webime, web_ime
외국 나갔을때 한글 윈도우 또는 한글 IME 설치가 되어 있지 않는 경우 영문을 한글로 바꿔주는 웹 IME입니다.
http://oxtag.com/php/webIme/



한자사전
http://211.46.71.249/handic/



아이콘 사이트
http://www.garamart.com/icons06071/Icon_main/iconindex.asp
http://www.garamart.com/



귀여운 퍼스나콘 모음
http://blog.naver.com/dnelfksp/40030886279



Escape ↔ Unescape
UTF8 Encode ↔ UTF8 Dncode
URL Encode ↔ URL Dncode

소스 및 미리보기 : http://oxtag.com/php/p/utf8_encode.php


URL Encode / URL Decode / Escape / Unescape ...
미리보기 : http://oxtag.com/php/p/unicode/StringConversion.php



인코딩 - 암호화,복호화
http://oxtag.com/php/p/encoder.php



파일명 한글일때 인코딩
파일명이 한글인 경우 이미지가 엑박으로 뜨거나 음악이 재생 안될때 사용하세요.
http://oxtag.com/php/p/URLChange2.php



바이오리듬 - biorhythm
http://oxtag.com/php/biorhythm2/biorhythm.php



소스 하일라이터 - 소스색상입히기
http://oxtag.com/php/SourceHighlight/



CPP2HTM - 소스하일라이트, 소스색상입히기
http://oxtag.com/php/p/CPP2HTM/input.php



후이즈 도메인 검색
http://oxtag.com/cgi/WHOIS/whois.cgi



웹 FTP, 웹FTP, web ftp
계정정보는 저장되지 않으니까 안심하셔도됨니다.
FTP 프로그램을 설치하지 않고, 계정에 접속할 수 있습니다.
http://oxtag.com/html/webftp/ftp.html
http://oxtag.com/php/webFtp/



기대 수명 계산기
http://oxtag.com/html/ex/health.html



모질라, 파이어폭스, FF 를 위한 웹표준화 가이드, 레퍼런스
http://www.mozilla.or.kr/docs/web-developer/standard/
http://developer.mozilla.org/en/docs/Gecko_DOM_Reference



PHP 메뉴얼 chm 한글 버전
http://kr2.php.net/get/php_manual_kr.chm/from/a/mirror



PHP로 만들어진 오픈형 채팅솔루션
http://phpopenchat.org/



실시간 메모 보내기, 실시간 쪽지 보내기
테스트 주소 :
                   팝   업 - http://oxtag.com/php/reChat/
                   레이어 - http://oxtag.com/php/reChat/index2.php
메모는 읽음과 동시에 자동 삭제처리 했습니다.
태그 : 접속자 아이피, 실시간 메모, 실시간 쪽지 보내기



브라우저 지원 글자 알아보기
http://oxtag.com/html/ex/len20070518.html



스누피 Snoopy HTTP 에뮬레이션, 소켓 연결
http://sourceforge.net/projects/snoopy



스크롤바, 투명스크롤바
http://oxtag.com/html/ex/scrollbar_color.html



색상표, 색상, 컬러, color
http://oxtag.com/html/rgbcolor.htm
http://oxtag.com/html/ex/colorcode/colorcode01.html



폰트 사이트
http://www.zellibbi.com/


Posted by 알 수 없는 사용자
,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Jasko Sample Script </TITLE>
<META NAME="Author" CONTENT="JASKO">
<META NAME="Keywords" CONTENT="javascript, 자바스크립트, 자바">
<META NAME="Description" CONTENT="자바스크립트 소스뱅크 - 자스코">

<!---- [1단계] 아래의 소스코드를 <HEAD>와 </HEAD> 사이에 붙여 넣으세요 ---->


<SCRIPT LANGUAGE="JavaScript">
<!--
  function Calculate()
  {
    if(document.form1.switcher.value == "=>")
      timeToHuman();
    else if(document.form1.switcher.value == "<=")
      humanToTime();
  }
  function timeToHuman()
  {
    var theDate = new Date(document.form1.timeStamp.value * 1000);
    dateString = theDate.toGMTString();
    arrDateStr = dateString.split(" ");
    document.form1.inMon.value = getMonthNum(arrDateStr[2]);
    document.form1.inDay.value = arrDateStr[1];
    document.form1.inYear.value = arrDateStr[3];
    document.form1.inHr.value = arrDateStr[4].substr(0,2);
    document.form1.inMin.value = arrDateStr[4].substr(3,2);
    document.form1.inSec.value = arrDateStr[4].substr(6,2);
  }
  function humanToTime()
  {
    var humDate = new Date(date.utc(document.form1.inYear.value,
          (stripLeadingZeroes(document.form1.inMon.value)-1),
          stripLeadingZeroes(document.form1.inDay.value),
          stripLeadingZeroes(document.form1.inHr.value),
          stripLeadingZeroes(document.form1.inMin.value),
          stripLeadingZeroes(document.form1.inSec.value)));
    document.form1.timeStamp.value = (humDate.getTime()/1000.0);
  }
  function pointRight()
  {
    document.form1.switcher.value="=>";
  }
  function pointLeft()
  {
    document.form1.switcher.value="<=";
  }
  function stripLeadingZeroes(input)
  {
    if((input.length > 1) && (input.substr(0,1) == "0"))
      return input.substr(1);
    else
      return input;
  }
  function getMonthNum(abbMonth)
  {
    var arrMon = new Array("Jan","Feb","Mar","Apr","May","Jun",
          "Jul","Aug","Sep","Oct","Nov","Dec");
    for(i=0; i<arrMon.length; i++)
    {
      if(abbMonth == arrMon[i])
        return i+1;
    }
  }
//  -->
</script>

<!------------------------- 여기까지 ---------------------------------->

</HEAD>

<BODY>

<!---- [2단계] 아래의 코드를 <BODY> 태그와 </BODY> 태그안에 붙여 넣으세요 ---->


<form name=form1>
<table border=0>
<tr>
  <th>유닉스 타임스탬프 값 (초) :</th>
  <td valign=bottom rowspan=2>
    <input type=button name=switcher value="변환하기" onClick="Calculate();"></td>
  <th>년:</th>
  <th> </th>
  <th>월:</th>
  <th> </th>
  <th>일:</th>
  <th> </th>
  <th>시:</th>
  <th> </th>
  <th>분:</th>
  <th> </th>
  <th>초:</th>
  <th> </th>
</tr>
<tr>
  <td align=center><input type=text size=20 maxlength=11 name=timeStamp onKeyUp="pointRight();"></td>
  <td><input type=text size=4 maxlength=4 name=inYear onKeyUp="pointLeft();"></td>
  <th>/</th>
  <td><input type=text size=4 maxlength=2 name=inMon onKeyUp="pointLeft();"></td>
  <th>/</th>
  <td><input type=text size=4 maxlength=2 name=inDay onKeyUp="pointLeft();"></td>

  <th>  </th>
  <td><input type=text size=4 maxlength=2 name=inHr onKeyUp="pointLeft();"></td>
  <th>:</th>
  <td><input type=text size=4 maxlength=2 name=inMin onKeyUp="pointLeft();"></td>
  <th>:</th>
  <td><input type=text size=4 maxlength=2 name=inSec onKeyUp="pointLeft();"></td>
  <th>GMT</th>
</tr>
</table>
</form>

<!------------------------- 여기까지 ---------------------------------->

</BODY>
</HTML>
Posted by 알 수 없는 사용자
,