- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
StrToTime.cpp
资源名称:停车场管理系统.zip [点击查看]
上传用户:trilite
上传日期:2007-04-24
资源大小:261k
文件大小:1k
源码类别:
酒店行业
开发平台:
Visual C++
- // StrToTime.cpp: implementation of the StrToTime class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "StrToTime.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CStrToTime::CStrToTime()
- {
- }
- CStrToTime::~CStrToTime()
- {
- }
- CTime CStrToTime::FormatDateTime(CString strTime)
- {
- int year,month,day,hour,minute,second;
- year = atoi(strTime.Mid(0,4));
- month = atoi(strTime.Mid(5,2));
- day = atoi(strTime.Mid(8,2));
- hour = atoi(strTime.Mid(11,2));
- minute = atoi(strTime.Mid(14,2));
- if (strTime.GetLength() >= 17)
- {
- second = atoi(strTime.Mid(17,2));
- }
- else
- {
- second = 0;
- }
- CTime time(year,month,day,hour,minute,second,-1);
- return time;
- }
- CTime CStrToTime::FormatDate(CString strTime)
- {
- int year,month,day;
- year = atoi(strTime.Mid(0,4));
- month = atoi(strTime.Mid(5,2));
- day = atoi(strTime.Mid(8,2));
- CTime time(year,month,day,12,0,0,-1);
- return time;
- }
- CTime CStrToTime::FormatTime(CString strTime)
- {
- int hour,minute,second;
- hour = atoi(strTime.Mid(0,2));
- minute = atoi(strTime.Mid(3,2));
- if (strTime.GetLength() >= 6)
- {
- second = atoi(strTime.Mid(6,2));
- }
- else
- {
- second = 0;
- }
- CTime time(2000,1,1,hour,minute,second,-1);
- return time;
- }