Forum Discussion
peter_werk
3 years agoFrequent Visitor
Substract 10 minutes from TimeDate.UtcNow()
Hello I have a problem with subtracting minutes from time now in UTC timezone. The problem if reformatting the date Expression.Error: We cannot convert the value #datetimezone(2023, 5, 5, 8, 17,...
Anonymous
3 years agoNot applicable
Hi peter_werk ,
If you want to format the datetime to a fixed format. You could do as follows.
formattedTime =Number.ToText(Date.Year(dateTimeValue))&"-"&Text.PadStart(Number.ToText(Date.Month(dateTimeValue)),0,"2")&"-"&Text.PadStart(Number.ToText(Date.Day(dateTimeValue)),0,"2")&"T"&Text.PadStart(Number.ToText(Time.Hour(dateTimeValue)),0,"2")&":"&Text.PadStart(Number.ToText(Time.Minute(dateTimeValue)),0,"2")&":"&Text.PadStart(Number.ToText(Number.RoundUp(Time.Second(dateTimeValue))),2,"0"),
You can download my attachment for details.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.