Skip to content

Instantly share code, notes, and snippets.

@deltastateonline
Last active June 14, 2024 06:36
Show Gist options
  • Save deltastateonline/083be946e491957eabe4121afe43b923 to your computer and use it in GitHub Desktop.
Save deltastateonline/083be946e491957eabe4121afe43b923 to your computer and use it in GitHub Desktop.
Format Date Logic App
/General/Test Folder/file_uploaded/@{formatDateTime(utcNow(),'yyyy-MM-dd')}
processedDate": "@{convertFromUtc(utcNow(),'E. Australia Standard Time','yyyy-MM-dd')}
EndOfWeek : addDays(formatDateTime(variables('startDate'), 'yyyy-MM-ddT12:00:00.0000000Z'),sub(5,dayOfWeek(formatDateTime(variables('startDate'), 'yyyy-MM-ddT12:00:00.0000000Z'))))
@deltastateonline
Copy link
Author

Calculatte the End of Week,
if friday is at index 5 then
subtract 5 from the index of the start date (dayOfWeek).
then add the result to the start date.

So for monday with index 1, add 5 - 1 days
For friday index 5 add 5 -5 days

@deltastateonline
Copy link
Author

deltastateonline commented Jun 14, 2024

formatDateTime(convertFromUtc(utcNow(), 'E. Australia Standard Time'),'yyyy-MM-dd/HH')
formatDateTime(convertFromUtc(utcNow(), 'E. Australia Standard Time'),'yyyy-MM-dd HH:mm:ss')
formatDateTime(convertFromUtc(utcNow(), 'E. Australia Standard Time'),'dd/MM/yyyy')
@{convertFromUtc(utcNow(),'E. Australia Standard Time','yyyy-MM-dd HH:mm:ss')}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment