DateTimeSecond

 

Extracts the second component from a given DateTime object.

 

int @DateTimeSecond(object datetime);

 

Parameters

object datetime: The DateTime object from which to extract the second.

 

Return Value

Returns the second component of the DateTime object.

 

Example

t = @DateTimeNow();
year = @DateTimeYear(t);
month = @DateTimeMonth(t);
day = @DateTimeDay(t);
hour = @DateTimeHour(t);
minute = @DateTimeMinute(t);
second = @DateTimeSecond(t);
millisecond = @DateTimeMillisecond(t);

dow = @DateTimeDayOfWeek(t);
doy = @DateTimeDayOfYear(t);

@sprintf(buf, "%d-%d-%d %02d:%02d:%02d.%03d dow=%d,doy=%d", year, month, day, hour, minute, second, millisecond, dow, doy);
@Message(buf);

 

Description: Retrieves the current time into a DateTime object, extracts each element, and displays them as a formatted message.

 

Version Information

Supported Version: 10.3.0 or Higher

 

Related Helps

@DateTimeAddDays()

@DateTimeAddHours()

@DateTimeAddMilliseconds()

@DateTimeAddMinutes()

@DateTimeAddMonths()

@DateTimeAddSeconds()

@DateTimeAddYears()

@DateTimeDay()

@DateTimeDayOfWeek()

@DateTimeDayOfYear()

@DateTimeHour()

@DateTimeMillisecond()

@DateTimeMinute()

@DateTimeMonth()

@DateTimeNew()

@DateTimeNow()

@DateTimeSecond()

@DateTimeUtcNow()

@DateTimeYear()