Einzelnen Beitrag anzeigen
  #1 (permalink)  
Alt 28.12.13
Deepack Deepack ist offline
Mitglied
 
Registriert seit: Mar 2012
Ort: Wien
Beiträge: 191
Deepack befindet sich auf einem aufstrebenden Ast
Deepack eine Nachricht über Skype™ schicken
Standard Wochentag einer beliebigen Kerze ermitteln

bin gerade am auswerten wie es sich um wochentage verhält

vl kann das codestück jemand brauchen
Code:

int xdayofweek(int Bar)     
{ 

int y = StrToDouble(StringSubstr(TimeToStr(Time[Bar],TIME_DATE),0,4)); 
int m = StrToDouble(StringSubstr(TimeToStr(Time[Bar],TIME_DATE),5,2)); 
int d = StrToDouble(StringSubstr(TimeToStr(Time[Bar],TIME_DATE),8,2));


  static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}; 
  
    y -= m < 3; 
  
  double x = (y + y/4 - y/100 + y/400 + t[m-1] + d);
  int z = (x / 7);
    
  return( x - (z*7));
  
}
die funktion gibt einen wert von 0 - 6 retour
0 - Sonntag
...
6 - Samstag