GetDayOfMonthByDateTime
Syntax
GetDayOfMonthByDateTime(ftoDate: FTODate): numberParameters
Return Value
Description
Example
// Create FTODate object
const currentDate = this.api.TimeCurrent();
const day = this.api.GetDayOfMonthByDateTime(currentDate);
console.log(`Day of month: ${day}`);
// Format with leading zero
const formattedDay = day.toString().padStart(2, "0");
console.log(`Formatted day: ${formattedDay}`);
// Check for month end
const month = currentDate.monthOf();
const year = currentDate.yearOf();
const lastDayOfMonth = new Date(year, month, 0).getDate();
const isMonthEnd = day === lastDayOfMonth;
console.log(`Is month end: ${isMonthEnd}`);
// Format full date
console.log(`Date: ${year}.${month}.${formattedDay}`);Last updated