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

Annotation of /trunk/libxmltv/Extensions.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 141 - (hide annotations) (download)
Thu Mar 14 13:08:20 2013 UTC (7 years, 8 months ago) by william
File size: 914 byte(s)
+ fix datetime start/stop strings sometimes only showing the date and not the time

1 william 141 using System;
2     using System.Collections.Generic;
3     using System.Linq;
4     using System.Text;
5    
6     namespace libxmltv
7     {
8     internal 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