--- YodaProfiler/src/GLTables.cpp 2006/09/08 14:42:48 1.9 +++ YodaProfiler/src/GLTables.cpp 2006/09/22 09:18:06 1.11 @@ -1114,41 +1114,51 @@ * @param tzone Time Zone, can be UTC,GMT,CET,CEST,MSD default is MSK * */ -TString GL_TIMESYNC::ConvertTime(TString tzone, UInt_t dbt){ +TString GL_TIMESYNC::ConvertTime(TString &tzone, UInt_t dbt){ // TDatime *time = new TDatime(); TString rtime; + Bool_t found = false; // - time->Set(dbt,false); // MSK = Moscow Winter Time + time->Set(dbt,false); // UTC (Coordinated Universal Time) // - if ( !strcmp(tzone.Data(),"UTC") || !strcmp(tzone.Data(),"GMT") ){ + if ( !strcmp(tzone.Data(),"MSK") || !strcmp(tzone.Data(),"MWT") ){ // - UInt_t timeUTC = time->Convert() - 60*60*3; // UTC (Coordinated Universal Time) = Moscow Winter Time - 3 hs - time->Set(timeUTC,false); + UInt_t timeMSK = time->Convert() + 60*60*3; // UTC (Coordinated Universal Time) + 3hs = Moscow Winter Time + time->Set(timeMSK,false); + found = true; // }; // if ( !strcmp(tzone.Data(),"CET") ){ // - UInt_t timeCET = time->Convert() - 60*60*2; // CET (Central European Time) = Moscow Winter Time - 2 hs + UInt_t timeCET = time->Convert() + 60*60*1; // CET (Central European Time) = UTC + 1 hs time->Set(timeCET,false); + found = true; // }; // if ( !strcmp(tzone.Data(),"CEST") ){ // - UInt_t timeCEST = time->Convert() - 60*60*1; // CEST (Central European Summer Time) = Moscow Winter Time - 1 h + UInt_t timeCEST = time->Convert() + 60*60*2; // CEST (Central European Summer Time) = UTC + 2 h time->Set(timeCEST,false); + found = true; // }; // - if ( !strcmp(tzone.Data(),"MSD") ){ + if ( !strcmp(tzone.Data(),"MSD") || !strcmp(tzone.Data(),"MST")){ // - UInt_t timeMSD = time->Convert() + 60*60*1; // MSD (Moscow Summer Time) = Moscow Winter Time + 1 h + UInt_t timeMSD = time->Convert() + 60*60*4; // MSD (Moscow Summer Time) = UTC + 4 h time->Set(timeMSD,false); + found = true; // }; // + if ( !found && strcmp(tzone.Data(),"UTC") && strcmp(tzone.Data(),"GMT") && strcmp(tzone.Data(),"") ){ + printf("\n Unknown time zone %s using UTC \n",tzone.Data()); + tzone = "UTC"; + }; + // rtime = time->AsSQLString(); // return(rtime); @@ -1162,39 +1172,51 @@ * @param tzone Time Zone, can be UTC,GMT,CET,CEST,MSD default is MSK * */ -TString GL_TIMESYNC::UnConvertTime(TString tzone, UInt_t dbt){ +TString GL_TIMESYNC::UnConvertTime(TString &tzone, UInt_t dbt){ // TDatime *time = new TDatime(); TString rtime; // - time->Set(dbt,false); // MSK = Moscow Winter Time + Bool_t found = false; + // + time->Set(dbt,false); // tzone // - if ( !strcmp(tzone.Data(),"UTC") || !strcmp(tzone.Data(),"GMT") ){ + if ( !strcmp(tzone.Data(),"MSK") || !strcmp(tzone.Data(),"MWT") ){ // - UInt_t timeUTC = time->Convert() + 60*60*3; // UTC (Coordinated Universal Time) +3 hs = Moscow Winter Time + UInt_t timeUTC = time->Convert() - 60*60*3; // UTC (Coordinated Universal Time) = Moscow Winter Time - 3hs time->Set(timeUTC,false); + found = true; // }; // if ( !strcmp(tzone.Data(),"CET") ){ // - UInt_t timeCET = time->Convert() + 60*60*2; // CET (Central European Time) + 2 hs = Moscow Winter Time + UInt_t timeCET = time->Convert() - 60*60*1; // CET (Central European Time) - 1 hs = UTC time->Set(timeCET,false); + found = true; // }; // if ( !strcmp(tzone.Data(),"CEST") ){ // - UInt_t timeCEST = time->Convert() + 60*60*1; // CEST (Central European Summer Time) + 1 h = Moscow Winter Time + UInt_t timeCEST = time->Convert() - 60*60*2; // CEST (Central European Summer Time) - 2 h = UTC time->Set(timeCEST,false); + found = true; // }; // - if ( !strcmp(tzone.Data(),"MSD") ){ + if ( !strcmp(tzone.Data(),"MSD") || !strcmp(tzone.Data(),"MST") ){ // - UInt_t timeMSD = time->Convert() - 60*60*1; // MSD (Moscow Summer Time) - 1 h = Moscow Winter Time + UInt_t timeMSD = time->Convert() - 60*60*4; // MSD (Moscow Summer Time) - 4 h = UTC time->Set(timeMSD,false); + found = true; + // + }; + // + if ( !found && strcmp(tzone.Data(),"UTC") && strcmp(tzone.Data(),"GMT") && strcmp(tzone.Data(),"") ){ // + printf("\n Unknown time zone %s using UTC \n",tzone.Data()); + tzone = "UTC"; }; // rtime = time->AsSQLString();