//日期时间函数--41个 export const DateTimeFunc = [ { "key": "DateTimeAddDays", "name": "DateTimeAddDays", "params": [ { "key": "date", "name": "date", "type": "string" }, { "key": "value", "name": "value", "type": "int" } ], "description": `[Function]: Add the specified number of days to the specified date and time \n[Return value type]: DateTime (DateTime)\n[Example]: DateTimeAddDays("2019-01-30T10:00:00+08:00", 2 )[Return value]: 2019-02-01T10:00+08:00`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "DateTimeAddYears", "name": "DateTimeAddYears", "params": [ { "key": "date", "name": "date", "type": "string" }, { "key": "value", "name": "value", "type": "int" } ], "description": `[Function]: Add the specified number of years to the specified date and time \n[Return value type]: DateTime (DateTime)\n[Example]: DateTimeAddYears("2019-01-30T10:00:00+08:00", 2 )[Return value]:2021-01-30T10:00+08:00`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "DateTimeAddMonths", "name": "DateTimeAddMonths", "params": [ { "key": "date", "name": "date", "type": "string" }, { "key": "value", "name": "value", "type": "int" } ], "description": `[Function]: Add the specified number of months to the specified date and time \n[Return value type]: DateTime (DateTime)\n [Example]: DateTimeAddMonths("2019-01-30T10:00:00+08:00) ",1)[Return value]: 2019-02-28T10:00+08:00`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "GetFirstDayOfMonth", "name": "GetFirstDayOfMonth", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Get the date of the first day of the month where the specified date and time are located \n[Return value type]: DateTime (DateTime)\n [Example]: GetFirstDayOfMonth("2019-01-30T10:00 :00+08:00")[Return value]: 2019-01-01T10:00+08:00`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "GetLastDayOfMonth", "name": "GetLastDayOfMonth", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Get the date of the last day of the month where the specified date and time are located \n[Return value type]: DateTime (DateTime)\n[Example]: GetLastDayOfMonth("2019-01- 30T10:00:00+08:00")[Return value]: 2019-01-31T10:00+08:00`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "GetDateTimeNow", "name": "GetDateTimeNow", "params": [], "description": `[Function]: Get the current date and time \n[Return value type]: DateTime (DateTime)\n[Example]: GetDateTimeNow() [Return value]: 2019-01-30T12:00:00.000+08:00 `, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "CompareDate", "name": "CompareDate", "params": [ { "key": "str1", "name": "date1", "type": "string" }, { "key": "str2", "name": "date2", "type": "string" } ], "description": `[Function]: Compare two time values and return an integer \n[Return value type]: Numeric (int32) date 1 is earlier than date 2, return -1; date 1 is equal to date 2, return 0; date 1 is later than date 2 , Return 1\n[Example]: CompareDate("2019-01-30T10:00:00+08:00", "2019-02-01T10:00:00+08:00") [Return value] : -1`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "FormatDate", "name": "FormatDate", "params": [ { "key": "format", "name": "format", "type": "string" } ], "description": `[Function]: Use the specified format to convert the current date and time value into its equivalent string representation \n[Return value type]: String (String)\n [Example]: FormatDate("yyyy-MM- dd HH:mm:ss")[Return value]: "2019-01-30 01:00:00"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "FormatDefineDate", "name": "FormatDefineDate", "params": [ { "key": "format", "name": "format", "type": "string" }, { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Use the specified format to convert the specified date and time value into its equivalent string representation \n[Return value type]: String (String)\n [Example]: FormatDefineDate("yyyy-MM -dd HH:mm:ss","2019-01-30 01:00:00") [Return value]: "2019-01-30 01:00:00"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "Today", "name": "Today", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return today of the specified date, the format is "yyyy-MM-dd", without parameters, it will return to today of the current date by default \n[Return value type]: String (String)\n [Example]: Today(" 2019-01-30T10:00:00+08:00")[Return value]: "2019-01-30"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "Yesterday", "name": "Yesterday", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the yesterday of the specified date, the format is "yyyy-MM-dd", if there is no parameter, it will return the yesterday of the current date by default. \n[Return value type]: String (String)\n [Example]: Yesterday(" 2019-01-30T10:00:00+08:00")[Return value]: "2019-01-29"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "Tomorrow", "name": "Tomorrow", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return tomorrow of the specified date, the format is "yyyy-MM-dd", without parameters, it will default to tomorrow of the current date \n[Return value type]: String (String)\n [Example]: Tomorrow(" 2019-01-30T10:00:00+08:00")[Return value]: "2019-01-31"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "ThisYear", "name": "ThisYear", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the current year of the specified date, the format is "yyyy", without parameters, it will default to the current year of the current date. \n[Return value type]: String (String)\n [Example]: ThisYear("2019 -01-30T10:00:00+08:00")[Return value]: "2019"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastYear", "name": "LastYear", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last year of the specified date, the format is "yyyy", if there is no parameter, it will return the last year of the current date by default. \n[Return value type]: String (String)\n [Example]: LastYear("2019-01- 30T10:00:00+08:00")[Return value]: "2018"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "NextYear", "name": "NextYear", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the next year of the specified date, the format is "yyyy", if there is no parameter, it will return the next year of the current date by default. \n[Return value type]: String (String)\n [Example]: NextYear ("2019-01- 30T01:00:00+08:00")[Return value]: "2020"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "ThisMonth", "name": "ThisMonth", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the current month of the specified date, the format is "MM", without parameters, it will return the current month of the current date by default. \n[Return value type]: String (String)\n [Example]: This month ("2019 -01-30T01:00:00+08:00")[Return value]: "1"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastMonth", "name": "LastMonth", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last month of the specified date, the format is "MM", without parameters, it will default to the last month of the current date. \n[Return value type]: String (String)\n [Example]: LastMonth ("2019 -02-30 01:00:00")[Return value]: "1"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "NextMonth", "name": "NextMonth", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the next month of the specified date, the format is "MM", without parameters, the next month of the current date will be returned by default. \n[Return value type]: String (String)\n [Example]: NextMonth ("2019 -01-30T01:00:00+08:00")[Return value]: "2"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "ThisWeek", "name": "ThisWeek", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the week of the specified date in the current year, the format is "ww", without parameters, the default return is the week of the current date in the year \n[Return value type]: String (String)\n[ Example]: ThisWeek ("2019-01-30T01:00:00+08:00") [Return value]: "5"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastWeek", "name": "LastWeek", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last week of the specified date, the format is "ww", if there is no parameter, it will return the last week of the current date by default. \n[Return value type]: String (String)\n [Example]: LastWeek ("2019 -01-30T01:00:00+08:00")[Return value]: "4"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "NextWeek", "name": "NextWeek", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the next week of the specified date, the format is "ww", without parameters, it will return the next week of the current date by default \n[Return value type]: String (String)\n [Example]: NextWeek ("2019 -01-30T01:00:00+08:00")[Return value]: "6"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "DayOfWeek", "name": "DayOfWeek", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the specified date is the day of the week, the format is "n", if there is no parameter, the default return current date is the day of the week \n[Return value type]: String (String)\n [Example]: DayOfWeek("2019-01-30T01:00:00+08:00") [Return value]: "3"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "FirstDayOfWeek", "name": "FirstDayOfWeek", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the first day of the week of the specified date, the format is "yyyy-MM-dd", if there is no parameter, it will default to the first day of the week of the current date. \n[Return value type]: String (String)\n [Example]: FirstDayOfWeek("2019-01-30T01:00:00+08:00") [Return value]: "2019-01-28"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastDayOfWeek", "name": "LastDayOfWeek", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last day of the week on the specified date, the format is "yyyy-MM-dd", if there is no parameter, it will default to the first day of the week on the current date \n[Return value type]: String (String)\n[ Example]: LastDayOfWeek("2019-01-30T01:00:00+08:00") [Return value]: "2019-02-03"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "FirstDayOfLastWeek", "name": "FirstDayOfLastWeek", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the first day of the last week of the specified date, the format is "yyyy-MM-dd", if there is no parameter, it will default to the first day of the last week of the current date. \n[Return value type]: String (String)\n [Example]: FirstDayOfLastWeek("2019-01-30T01:00:00+08:00") [Return value]: "2019-01-21"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastDayOfLastWeek", "name": "LastDayOfLastWeek", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last day of the last week of the specified date, the format is "yyyy-MM-dd", without parameters, it will default to the last day of the last week of the current date. \n[Return value type]: String (System.String)\n [Example]: LastDayOfLastWeek("2019-01-30T01:00:00+08:00") [Return value]: "2019-01-27"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "FirstDayOfNextWeek", "name": "FirstDayOfNextWeek", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the first day of the next week of the specified date, the format is "yyyy-MM-dd", without parameters, it will default to the first day of the next week of the current date. \n[Return value type]: String (String)\n [Example]: FirstDayOfNextWeek("2019-01-30T01:00:00+08:00") [Return value]: "2019-02-04"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastDayOfNextWeek", "name": "LastDayOfNextWeek", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last day of the next week of the specified date, the format is "yyyy-MM-dd", without parameters, it will return the last day of the next week of the current date by default \n[Return value type]: String (String)\n [Example 】: LastDayOfNextWeek("2019-01-30T01:00:00+08:00") [Return value]: "2019-02-10"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "FirstDayOfMonth", "name": "FirstDayOfMonth", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the first day of the month of the specified date, the format is "yyyy-MM-dd", without parameters, it will default to the first day of the month of the current date. \n[Return value type]: String (String)\n [Example]: FirstDayOfMonth("2019-01-30T01:00:00+08:00") [Return value]: "2019-01-01"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastDayOfMonth", "name": "LastDayOfMonth", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last day of the month on the specified date, the format is "yyyy-MM-dd", if there is no parameter, it will return the last day of the month on the current date by default \n[Return value type]: String (String)\n [Example 】: LastDayOfMonth("2019-01-30T01:00:00+08:00") [Return value]: "2019-01-31"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "FirstDayOfLastMonth", "name": "FirstDayOfLastMonth", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the first day of the previous month of the specified date, in the format "yyyy-MM-dd", without parameters, it will default to the first day of the previous month of the current date. \n[Return value type]: String (String)\n [Example]: FirstDayOfLastMonth("2019-01-30T01:00:00+08:00") [Return value]: "2018-12-01"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastDayOfLastMonth", "name": "LastDayOfLastMonth", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last day of the previous month of the specified date, the format is "yyyy-MM-dd", if there is no parameter, it will default to the last day of the previous month of the current date. \n[Return value type]: String (String)\n [Example 】: LastDayOfLastMonth("2019-01-30T01:00:00+08:00") [Return value]: "2018-12-31"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "FirstDayOfNextMonth", "name": "FirstDayOfNextMonth", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the first day of the next month of the specified date, the format is "yyyy-MM-dd", without parameters, it will default to the first day of the next month of the current date. \n[Return value type]: String (String)\n [Example]: FirstDayOfNextMonth("2019-01-30T01:00:00+08:00") [Return value]: "2019-02-01"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastDayOfNextMonth", "name": "LastDayOfNextMonth", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last day of the next month of the specified date, the format is "yyyy-MM-dd", without parameters, it will default to the last day of the next month of the current date \n[Return value type]: String (String)\n [Example]: LastDayOfNextMonth("2019-01-30T01:00:00+08:00") [Return value]: "2019-02-28"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "FirstDayOfYear", "name": "FirstDayOfYear", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the first day of the current year of the specified date, the format is "yyyy-MM-dd", if there is no parameter, it will default to the first day of the current year of the current date. \n[Return value type]: String (String)\n [Example]: FirstDayOfYear("2019-01-30T01:00:00+08:00") [Return value]: "2019-01-01"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastDayOfYear", "name": "LastDayOfYear", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last day of the current year of the specified date, the format is "yyyy-MM-dd", without parameters, it will default to the last day of the current year of the current date \n[Return value type]: String (String)\n [Example]: LastDayOfYear("2019-01-30T01:00:00+08:00") [Return value]: "2019-12-31"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "FirstDayOfLastYear", "name": "FirstDayOfLastYear", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the first day of the previous year of the specified date, the format is "yyyy-MM-dd", without parameters, it will default to the first day of the previous year of the current date. \n[Return value type]: String (String)\n [Example]: FirstDayOfLastYear("2019-01-30T01:00:00+08:00") [Return value]: "2018-01-01"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastDayOfLastYear", "name": "LastDayOfLastYear", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last day of the previous year on the specified date, the format is "yyyy-MM-dd", without parameters, it will default to the last day of the previous year on the current date \n[Return value type]: String (String)\n [Example]: LastDayOfLastYear("2019-01-30T01:00:00+08:00") [Return value]: "2018-12-31"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "FirstDayOfNextYear", "name": "FirstDayOfNextYear", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the first day of the next year of the specified date, the format is "yyyy-MM-dd", without parameters, it will default to the first day of the next year of the current date. \n[Return value type]: String (String)\n [Example]: FirstDayOfNextYear("2019-01-30T01:00:00+08:00") [Return value]: "2020-01-01"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "LastDayOfNextYear", "name": "LastDayOfNextYear", "params": [ { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the last day of the next year of the specified date, the format is "yyyy-MM-dd", without parameters, it will return the last day of the next year of the current date by default \n[Return value type]: String (String)\n [Example]: LastDayOfNextYear("2019-01-30T01:00:00+08:00") [Return value]: "2020-12-31"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" }, { "key": "GetDate", "name": "GetDate", "params": [ { "key": "format", "name": "format", "type": "string" }, { "key": "date", "name": "date", "type": "string" } ], "description": `[Function]: Return the date in the specified format, and return the current date in the specified format by default without parameters \n[Return value type]: String (String)\nDD: Today\tLD: Yesterday\tND: Tomorrow\tYY: This year\ tLY: Last year\tNY: Next year\tMM: This month\tLM: Last month\tNM: Next month\nWD: Day of the week\tWW: This week\tLW: Last week\tNW: Next week\tFDW: First week Day\tLDW: Last day of this week\nFDLW: First day of last week\tLDLW: Last day of last week\tFDNW: First day of next week\tLDNW: Last day of next week\tFDM: First day of this month\tLDM: Last day of this month \tFDLM: the first day of the previous month\tLDLM: the last day of the previous month\nFDNM: the first day of the next month\tLDNM: the last day of the next month\tFDY: the first day of the year\tLDY: the last day of the year\tFDLY: the first day of the previous year\ tLDLY: Last day of the previous year\tFDNY: First day of the next year\tLDNY: Last day of the next year\n[Example]: GetDate("LD","2019-01-30T01:00:00+08:00 ")[Return value]: "2019-01-29"`, "type": "DateTime", "keyFront": "DefaultFunction", "className": "" } ]