hlp:修改版本号规则
This commit is contained in:
+2
-23
@@ -369,33 +369,12 @@ QString Public::DateToString(char const *time){
|
||||
int month, day, year;
|
||||
//struct tm t = {0};
|
||||
static const char month_names[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
|
||||
//qDebug()<<time;
|
||||
sscanf(time, "%s %d %d", s_month, &day, &year);
|
||||
//qDebug()<<time<<s_month<<day<<year;
|
||||
|
||||
month = ((strstr(month_names, s_month)-month_names)/3)+1;
|
||||
//qDebug()<<month<<s_month;
|
||||
QString s;
|
||||
s.sprintf("%04d-%02d-%02d",year,month,day);
|
||||
return s;
|
||||
}
|
||||
|
||||
QString Public::ArmDate2String(const char *date, const char *time)
|
||||
{
|
||||
char s_month[5];
|
||||
int month, day, year;
|
||||
static const char month_names[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
|
||||
sscanf(date, "%s %d %d", s_month, &day, &year);
|
||||
month = ((strstr(month_names, s_month)-month_names)/3)+1;
|
||||
QString dateStr;
|
||||
dateStr.sprintf("A%04d%02d%02d",year,month,day);
|
||||
|
||||
int hour, min, secend;
|
||||
sscanf(time, "%d:%d:%d", &hour, &min, &secend);
|
||||
QString timeStr;
|
||||
timeStr.sprintf("%02d%02d", hour, min);
|
||||
|
||||
QString s = dateStr+timeStr;
|
||||
// s.sprintf("%04d-%02d-%02d",year,month,day);
|
||||
s.sprintf("%02d%02d",month,day);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user