TimeFromString

 

Get the date time from the time string.

 

void @TimeFromString(string buf, int year, int month, int day, int hour, int minute, int second);

 

Parameters

string buf : Date String

int year : variable to store the date obtained (year)

int month : Variable to store the date obtained (month)

int day : Variable to store the date obtained(day)

int hour : variable to store the date obtained (hour)

int minute : Variable to store the date obtained  (minute)

int second : Variable to store the date obtained (second)

 

Return Value

None

 

Example

buf = "2016-1-2 3:4:5";
@TimeFromString(buf, year, month, day, hour, minute, second);
if(year != 2016 || month != 1 || day != 2 || hour != 3 || minute != 4 || second != 5) {
   @sprintf(buf, "TimeFromString Error");
   @MessageBox(buf, "Test Failed", MB_OK);
   return;
}

 

Description : Convert a date string to an integer and check that it has been converted correctly.

 

Version Information

Supported version: 10.3.1 or higher

 

Related Helps

@TimeFromString()

@TimeGetWaiting()

@TimeMinusDay()

@TimeMinusHour()

@TimeMinusMin()

@TimeMinusMon()

@TimePlusDay()

@TimePlusHour()

@TimePlusMin()

@TimePlusMon()

@TimeSetLocalTime()

@TimeSolarToLunar()