|
찾아봤더니 이렇게 ~~
www.experts-exchange.com/Programming/Languages/CPP/Q_20278766.html
const int EpochDiff = 25569; // days between 30/12/1899 and 01/01/1970
const int SecsInDay = 86400; // number of seconds in a day
TDateTime TimeT_TDateTime(time_t Convertee)
{
TDateTime Result(((double)Convertee) / SecsInDay + EpochDiff);
return Result;
}
// Now to reverse this operation you can cast a TDateTime into a
// double and then apply the reverse mathematics:
time_t TDateTime_TimeT(TDateTime Convertee)
{
time_t Result((long)((((double)Convertee) - EpochDiff) * SecsInDay));
return Result;
}
구윤태 님이 쓰신 글 :
: time_t t;
: t = time(NULL);
:
: AnsiString strTime;
: strTime.printf("%ld",t);
:
: ShowMessage(strTime);
:
:
: 위처럼
: DateTimePicker 의 값을 long 값으로 변환 시켜서 디비에 넣고 싶은데
: 모르겠습니다 .
:
: 방법좀 알려주세요
|