update 20241201
This commit is contained in:
56
Client - Kopie/Backup/Helper/ConvertHelper.cs
Normal file
56
Client - Kopie/Backup/Helper/ConvertHelper.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OnDoc.Helper
|
||||
{
|
||||
public static class ConvertHelper
|
||||
{
|
||||
//public static MemoryStream Base64ToMemoryStram(string Base64String)
|
||||
//{
|
||||
// //data:image/gif;base64,
|
||||
// //this image is a single pixel (black)
|
||||
// byte[] bytes = Convert.FromBase64String(Base64String);
|
||||
|
||||
// using (MemoryStream ms = new MemoryStream(bytes))
|
||||
// {
|
||||
// image = Image.FromStream(ms);
|
||||
// }
|
||||
|
||||
// return image;
|
||||
//}
|
||||
|
||||
public enum DateTimeFormat{
|
||||
datumshort,
|
||||
datummedium,
|
||||
datumlong,
|
||||
|
||||
}
|
||||
public static string Datum(DateTime date, DateTimeFormat format) {
|
||||
switch (format)
|
||||
{
|
||||
case DateTimeFormat.datumshort:
|
||||
return date.ToShortDateString();
|
||||
break;
|
||||
case DateTimeFormat.datummedium:
|
||||
return date.ToString("dd.MMMM yyyy");
|
||||
break;
|
||||
case DateTimeFormat.datumlong:
|
||||
return date.ToLongDateString();
|
||||
break;
|
||||
default:
|
||||
return date.ToShortDateString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return date.ToString("dd.mm.yyyy");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user