Jump to content

sm2106

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by sm2106

  1. The problem is that I need to have reports from WinCC I have some data stored in WinCC. I want to see some value let say X. I have this value in WinCC database at 2015-07-31 22:00:00.001 and the same value in php at 2015-08-01 00:00:00.001. Probably the problem is that I have UTC time in PHP. But i do not know. Here is the rest of code with "time" Unfortunately in polish $rok = $_POST['rok']; echo $rok; $miesiac = $_POST['miesiac']; echo $miesiac; $_SESSION['rok'] = $rok; $_SESSION['miesiac'] = $miesiac; $data = new datetime($rok.'-'.$miesiac.'-01'); $data_P = $data->format('Y-m-d'); $_SESSION['dzien_p'] = $data_P; $interwal_m = new dateinterval('P1M'); $interwal_d = new dateinterval('P1D'); $data->add($interwal_m); $data_K = $data->format('Y-m-d'); $data->sub($interwal_d); $data_K = $data->format('Y-m-d'); $_SESSION['data_k'] = $data_K; $d_ost = $data->format('d'); $_SESSION['dzien_ost'] = $d_ost; function mkmatrix($rows,$cols){ $count = 1; $mk = array(); for ($i=0;$i<$rows;$i++){ for ($j=0;$j<$cols;$j++){ $mk[$i][$j]=$count++; } } return($mx); } $m1 = mkmatrix(31,52); settype ($sPro, "string"); settype ($sDsn, "string"); settype ($sSer, "string"); $sPro = "Provider=WinCCOLEDBProvider.1;"; $sDsn = "Catalog=CC_ExternalBrowsing;"; $sSer = "Data Source=.\WinCC"; $sCon = $sPro.$sDsn.$sSer; $conn = New COM("ADODB.Connection"); $conn->ConnectionString = $sCon; $conn->CursorLocation = 3; $conn->Open(); $oRs = New COM("ADODB.Recordset"); $oCom = New COM("ADODB.Command"); $oCom->CommandType = 1; $oCom->ActiveConnection = $conn;
  2. Hi, I have a problem. I have some data stored by WinCC, and I want to read them in PHP. If i do that i get data in UTC time. What Shoud i do to fix it? I'm not good in PHP. Part of code in PHP: $tn[0]="TAG:R,'Agregat_MOC\MOC','".$data_P." 00:00:00.001','".$data_K." 23:59:59.001'.',TIMESTEP=86400,261'";//srednia z dnia OK This is how it looks like $tn[0]="TAG:R,'Agregat_MOC\MOC','2015-08-01 00:00:00.001','2015-08-31 23:59:59.001'.',TIMESTEP=86400,261'";//srednia z dnia OK This is how it should looks like $tn[0]="TAG:R,'Agregat_MOC\MOC','2015-07-31 22:00:00.001','2015-08-31 21:59:59.001'.',TIMESTEP=86400,261'";//srednia z dnia OK Im in europe/warsaw timezone (it includes winter/summer time changing)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.