class Solution {
public:
string convertDateToBinary(string date) {
int y = 0;
int m = 0;
int d = 0;
string res = "";
y = stoi(date.substr(0, 4));
m = stoi(date.substr(5, 2));
d = stoi(date.substr(8, 2));
// cout << y << " " << m <<" " << d << endl;
string tmp = "";
while(y){
int a = y % 2;
y = y / 2;
tmp += to_string(a);
}
reverse(tmp.begin(),tmp.end());
res += tmp;
res += "-";
tmp = "";
while(m){
int a = m % 2;
m = m / 2;
tmp += to_string(a);
}
reverse(tmp.begin(),tmp.end());
res += tmp;
res += "-";
tmp = "";
while(d){
int a = d % 2;
d = d / 2;
tmp += to_string(a);
}
reverse(tmp.begin(),tmp.end());
res += tmp;
return res;
}
};