1、div() 返回两个数相除的整数部分
div(dividend: number, divisor: number)
Required. The number to divide by the Divisor.
Returns the result from dividing the two number
div(7, 2) // 返回结果: 3
div(6, 4) // 返回结果: 1
2、mod() 返回两个数相除的余数部分
mod(dividend: number, divisor: number)
Required. The number to divide by the Divisor.
Returns the remainder after dividing the two numbers (modulo)
mod(3, 2) // 返回结果: 1
mod(7, 4) // 返回结果: 3
3、sub() 返回两个数相减的结果。
sub(minuend: number, subtrahend: number)
Required. The number that Subtrahend is removed from.
Returns the result from subtracting two numbers
sub(7, 5) // 返回结果: 2
4、formatNumber() 格式化number
formatNumber(number: number, format: string, locale?: string)
Required. The number to be formatted.
Returns a formatted number string
formatNumber(float('10000.666666'), 'C2')
// 返回结果: $10,000.67 C: '$' 2: 保留两位小数
5、ticks() 返回指定时间的ticks值
ticks(timestamp: string)
Required. This is a string that contains the time.
Returns the number of ticks (100 nanoseconds interval) since 1 January 0001 00:00:00 UT of a string timestamp
ticks('2024-04-03')
// 返回结果: 638476992000000000// 计算俩个日期之间的天数
div(sub(ticks('2024-04-03'),ticks(outputs('2024-04-01'))),864000000000)
// 返回结果: 2
864000000000 => the number of ticks in a day
864000000000的计算过程:
1 day = 24 hours/day * 60 minutes/hour * 60 seconds/minute * 1,000,000,000 nanoseconds/second 1 day = 86,400,000,000,000 nanoseconds
1 day = 86,400,000,000,000 nanoseconds / (100 nanoseconds/tick) 1 day = 864,000,000,000 ticks
6、convertFromUtc() 将某个UTC时间转化成指定时区的指定格式的时间。
convertFromUtc(timestamp: string, destinationTimeZone: string, format?: string)
Required. A string that contains the time.
Converts a string timestamp passed in from a UTC to a target time zone
convertFromUtc(utcNow(), 'Singapore Standard Time', 'yyyy-MM-dd')
// 返回结果: 2024-04-03
destinationTimeZone: target time zone url
Time Zone Abbreviations - Worldwide List
formatRule url
Standard date and time format strings - .NET | Microsoft Learn