/[xmltv_parser]/trunk/libxmltv/Extensions.cs
ViewVC logotype

Contents of /trunk/libxmltv/Extensions.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 159 - (show annotations) (download)
Thu Mar 14 20:26:05 2013 UTC (6 years, 5 months ago) by william
File size: 912 byte(s)

1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 namespace libxmltv
7 {
8 public static class DateTimeStringConverter
9 {
10 private const string DEFAULT_DATE_FORMAT = "yyyy/MM/dd hh:mm tt";
11 public static string ToDateTimeString(this DateTime dt)
12 {
13 return dt.ToDateTimeString(DateTimeStringConverter.DEFAULT_DATE_FORMAT);
14 }
15 public static string ToDateTimeString(this DateTime dt, IFormatProvider provider)
16 {
17 return dt.ToString(provider);
18 }
19 public static string ToDateTimeString(this DateTime dt, string format)
20 {
21 return dt.ToString(format);
22 }
23 public static string ToDateTimeString(this DateTime dt, string format, IFormatProvider provider)
24 {
25 return dt.ToString(format, provider);
26 }
27 }
28
29 }

  ViewVC Help
Powered by ViewVC 1.1.22