(file) Return to CIMDateTime.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/CIMDateTime.cpp between version 1.74 and 1.75

version 1.74, 2006/09/15 17:42:28 version 1.75, 2006/09/26 17:24:06
Line 1511 
Line 1511 
 // //
 //============================================================================== //==============================================================================
  
 #if defined(PEGASUS_OS_TYPE_UNIX)  #if defined(PEGASUS_OS_TYPE_UNIX) || defined(PEGASUS_OS_VMS)
  
 CIMDateTime CIMDateTime::getCurrentDateTime() CIMDateTime CIMDateTime::getCurrentDateTime()
 { {
Line 1522 
Line 1522 
     // ATTN: if this fails on your platform, use time() to obtain the     // ATTN: if this fails on your platform, use time() to obtain the
     // sec element and set usec to zero.     // sec element and set usec to zero.
     struct timeval tv;     struct timeval tv;
   #if defined(PEGASUS_OS_VMS)
       void *tz = NULL;
   #else
     struct timezone tz;     struct timezone tz;
   #endif
     gettimeofday(&tv, &tz);     gettimeofday(&tv, &tz);
     sec = tv.tv_sec;     sec = tv.tv_sec;
     usec = Uint64(tv.tv_usec);     usec = Uint64(tv.tv_usec);
Line 1549 
Line 1553 
             // Assume 1 hour.             // Assume 1 hour.
             tzMinutesEast += 60;             tzMinutesEast += 60;
         }         }
 # elif defined(PEGASUS_OS_LINUX)  # elif defined(PEGASUS_OS_LINUX) || defined(PEGASUS_OS_VMS)
         tzMinutesEast = (int) tmval->tm_gmtoff/60;         tzMinutesEast = (int) tmval->tm_gmtoff/60;
 # else # else
         if (tz.tz_dsttime > 0)         if (tz.tz_dsttime > 0)
Line 1577 
Line 1581 
  
 //============================================================================== //==============================================================================
 // //
 // PEGASUS_OS_VMS  
 //  
 //==============================================================================  
   
 #if defined(PEGASUS_OS_VMS)  
   
 CIMDateTime CIMDateTime::getCurrentDateTime()  
 {  
     time_t mSysTime;  
     struct tm* tmval;  
   
     // Get time.  
   
     mSysTime = time(NULL);  
   
     // Get the localtime  
   
     tmval = localtime(&mSysTime);  
   
     // Initialize components.  
   
     Uint32 year = 1900 + tmval->tm_year;  
     Uint32 month = tmval->tm_mon + 1;  
     Uint32 day = tmval->tm_mday;  
     Uint32 hours = tmval->tm_hour;  
     Uint32 minutes = tmval->tm_min;  
     Uint32 seconds = tmval->tm_sec;  
   
     // ATTN: missing UTC offset here.  
   
     return CIMDateTime(year, month, day, hours, minutes, seconds, 0, 6, 0);  
 }  
   
 #endif /* PEGASUS_OS_VMS */  
   
 //==============================================================================  
 //  
 // PEGASUS_OS_TYPE_WINDOWS // PEGASUS_OS_TYPE_WINDOWS
 // //
 //============================================================================== //==============================================================================


Legend:
Removed from v.1.74  
changed lines
  Added in v.1.75

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2