📜  车把 c# datetime now - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:57.110000             🧑  作者: Mango

代码示例1
Handlebars.RegisterHelper(DateFormat, (output, context, data) => 
            {
                DateTime.TryParse(data[0].ToString(), out DateTime date);

                var dictionary = data[1] as HandlebarsDotNet.Compiler.HashParameterDictionary;
                var formatString = dictionary["formatString"];

                output.WriteSafeString(date.ToString(formatString.ToString()));
            });