You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
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");
|
|
}
|
|
}
|
|
}
|