- /*
- * Copyright 1995, 1996 Perforce Software. All rights reserved.
- *
- * This file is part of Perforce - the FAST SCM System.
- */
- /*
- * DateTime - get and set the date as a string
- */
- // size for Fmt, FmtDay
- # define DateTimeBufSize 20
- // size for FmtTz, which can say things like '0700 - Pacific Standard Time'
- # define DateTimeZoneBufSize 80
- class DateTime {
- public:
- DateTime() {}
- DateTime( const int date ) { Set( date ); }
- DateTime( const char *date, Error *e ) { Set( date, e ); }
- void Set( const char *date, Error *e );
- void Set( const int date ) { wholeDay = 0; tval = (time_t)date; }
- void SetNow() { Set( (int)Now() ); }
- int Compare( const DateTime &t2 ) const {
- return (int)(tval - t2.tval); };
- void Fmt( char *buf ) const;
- void FmtDay( char *buf ) const;
- void FmtTz( char *buf ) const;
- void FmtElapsed( char *buf, const DateTime &t2 );
- void FmtUnifiedDiff( char *buf ) const;
- int Value() const { return (int)tval; }
- int Tomorrow() const { return (int)tval + 24*60*60; }
- int IsWholeDay() const { return wholeDay; }
- static int Never() { return 0; }
- static int Forever() { return 2147483647; }
- // for stat() and utime() conversion
- static time_t Localize( time_t centralTime );
- static time_t Centralize( time_t localTime );
- int TzOffset( int *isdst = 0 ) const;
- protected:
- time_t Now();
- private:
- time_t tval;
- int wholeDay;
- };
- class DateTimeNow : public DateTime {
- public:
- DateTimeNow() : DateTime( (int)Now() ) {}
- } ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 7893 | Johan Nilsson | OFFLINE CHANGELIST 10 - SUBMITTED ON 2011/03/23 11:18:27 Upgrade project files to VS2010... and switching to msbuild for the entire project. Retargeted everything to .NET4 Client Profile for the time being, due to VS2010 C++ limitations (can't target anything other than 4.0 without complicating the setup too much). Shouldn't be too hard to retarget later if push comes to shove. Added VS2010 P4API stuff directly inside this project also to make things easier to get up and running for the moment. Removed old static P4API libraries. ____________________________________________________________ OFFLINE CHANGELIST 9 - SUBMITTED ON 2011/03/22 07:35:31 Converted to VS2010 « |
14 years ago |