I made a note of this because I was asked how to change a column containing only “time” to the time on the current date when working with Excel in Power Automate.
Objective



For instance, if Excel contains only “time” information, such as “I want to run a process at this time every day,” it is difficult to handle as is, so I will try converting this date to today’s date.
Method: Extract only the time with formatDateTime
First, add a Select action to transform the information in each Excel column.

// Date part addHours(utcNow(),9,'yyyy-MM-dd') // Time part (Connect these two with "T") formatDateTime(item()?['Time'],'HH:mm:ss') // *If taking time zone into account, add "+hh:MM" to the end. addHours(utcNow(),9,'yyyy-MM-dd') T formatDateTime(item()?['Time'],'HH:mm:ss') +09:00


// Date and time only formatDateTime(item()?['Time'],concat(addHours(utcNow(),9,'yyyy-MM-ddT'),'HH:mm:ss')) // Date and time with specified time zone formatDateTime(item()?['Time'],concat(addHours(utcNow(),9,'yyyy-MM-ddT'),'HH:mm:ss+09:00'))
コメント