This function should do what you need . C# function to convert long date string to short date instructions and example how to use in function help comments
Function LongDateToShortDateCslocaleSpecific
Function LongDateToShortDateCslocaleSpecific
;/
function ~&results ~date ~pattern ~CultureCode
;converts longdate string to shortdate string in c#
;REMARKS
;can be easily converted for other languages
;just change CulturCode "el-GR" in calling function to language needed
;and adjust the datepattern string "dddd, d MMMM yyyy" as well.
;see example below.
;to match the culture date string your trying convert
;for culture codes and date formats see
;http://www.basicdatepicker.com/samples/cultureinfo.aspx
;
;EXAMPLE
;for greek longdate to shortdate
;out
;str longdate = "Κυριακή, 25 Μαρτίου 2018"
;str result
;str datepattern = "dddd, d MMMM yyyy"
;str locale = "el-GR"
;LongDateToShortDateCslocaleSpecific(result longdate datepattern locale)
;out result
str code=
;using System;
;using System.Globalization;
;public class Example
;{
;,,public static string StaticFunc(string date, string pattern, string culturecode)
;,,{
;,,,;CultureInfo provider = String.IsNullOrEmpty(culturecode)
;;,,,,;? CultureInfo.InvariantCulture // Or use other default
;;,,,,;: new CultureInfo(culturecode);
;,,,string res = DateTime.ParseExact(date, pattern, provider).ToShortDateString();
;,,,return res;
;,,}
;}
str R=CsFunc(code date pattern CultureCode)
results = R
ret