Created
October 27, 2020 14:00
-
-
Save skalahonza/cd522cab0b2404039ea6e8e2fd72e94b to your computer and use it in GitHub Desktop.
Logic Apps expression for converting SAP datetime format into YYYY-MM-DD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
namespace PasswordAttack | |
{ | |
static class Program | |
{ | |
const string EXPRESSION = "replace(concat(take(items('For_each')?['DATAB'],4),'-',take(skip(items('For_each')?['DATAB'],4),2),'-',take(skip(items('For_each')?['DATAB'],6),2)),'0000-00-00','1753-01-01')"; | |
static void Main(string[] args) => | |
args | |
.Select(x => EXPRESSION.Replace("DATAB", x)) | |
.Select(x => "@{" + x + "}") | |
.ToList() | |
.ForEach(Console.WriteLine); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment