- Регистрация
- 30.09.2011
- Сообщения
- 914
- Благодарностей
- 90
- Баллы
- 28
I want to share something, this info, if I had known this, my life would have been easier at the beginning of Zenno.
For different kinds of templates, you need some snippets right, and usually, you search on the forum or need to pay to develop.
Today all codes are on the internet, someone asks on stack over forums, or you have it in documentation in Microsoft.
Ok, for example, you have date
Jan 1, 2009
and need to make snippet to convert for date
1/1/2009
When you ask google
" C# convert date"
you will get this page, for example
ok, we now have the code from this page
To convert C# into zenno snippet there is only several rules, first, to make variable
first line will be
string dateInput = project.Variables["date"].Value;
and second, we need to make return option and instead of
Console.WriteLine(parsedDate);
it will be
return parsedDate;
and now, our snippet will be
For someone who does not know or do not want to learn C#, just right google search keywords, convert variable and give return exit and all snippets are here for you.
For different kinds of templates, you need some snippets right, and usually, you search on the forum or need to pay to develop.
Today all codes are on the internet, someone asks on stack over forums, or you have it in documentation in Microsoft.
Ok, for example, you have date
Jan 1, 2009
and need to make snippet to convert for date
1/1/2009
When you ask google
" C# convert date"
you will get this page, for example
Convert strings to DateTime - .NET | Microsoft Learn
Learn techniques to parse strings that represent dates and times to create a DateTime from the date and time string.
docs.microsoft.com
ok, we now have the code from this page
C#:
string dateInput = "Jan 1, 2009";
var parsedDate = DateTime.Parse(dateInput);
Console.WriteLine(parsedDate);
// Displays the following output on a system whose culture is en-US:
// 1/1/2009 00:00:00
first line will be
string dateInput = project.Variables["date"].Value;
and second, we need to make return option and instead of
Console.WriteLine(parsedDate);
it will be
return parsedDate;
and now, our snippet will be
C#:
string dateInput = project.Variables["date"].Value;
var parsedDate = DateTime.Parse(dateInput);
return parsedDate;
// Displays the following output on a system whose culture is en-US:
// 1/1/2009 00:00:00