Power Automate里的常用方法

news/2024/6/20 21:32:14/文章来源:https://blog.csdn.net/u013803303/article/details/137344997

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

Springboot自动获取接口实现

ServiceLoader加载接口实现步骤 1.编写接口 public interface CommunicationAdapterFactory {void setKernel(LocalKernel kernel);boolean providesAdapterFor(Vehicle vehicle);BasicCommunicationAdapter getAdapterFor(Vehicle vehicle); }2.编写实现 // 实现类 1 publi…

ubuntu2204配置zabbix6.4高可用

zabbix6.4-HA 配置keepalived配置haproxy数据库高可用配置zabbix-server配置proxy配置客户端agent 本实验VMware搭建zabbix6.4高可用集群&#xff0c;搭配haproxykeepalived。 master&#xff0c;node节点搭建haproxykeepalibed主备并配置vip地址 三台控制节点搭建数据库高可用…

安全测试重点思考(上)--AWVS使用/XSS漏洞复现

AWVS使用/XSS漏洞复现 AWVS功能使用Dashboard功能Targets功能Vulnerabilities功能Scans功能Reports功能Discovery功能Users功能Scan ProfilesNetwork Scanner功能Issue Trackers功能WAFs功能Proxy Settings功能 漏洞测试实操DVWA介绍XSS分类反射型xss解决存储型xss解决 安全测试…

VMware虚拟机三种网络模式配置

vmware有三种网络工作模式&#xff1a;Bridged&#xff08;桥接模式&#xff09;、NAT&#xff08;网络地址转换模式&#xff09;、Host-Only&#xff08;仅主机模式&#xff09;。 1. 打开网络编辑器&#xff08;编辑 --> 虚拟网络编辑器&#xff09; 在主机上有VMware Ne…