ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/xmltv_parser/trunk/libxmltv/Extensions.cs
Revision: 141
Committed: Thu Mar 14 13:08:20 2013 UTC (9 years, 10 months ago) by william
File size: 914 byte(s)
Log Message:
+ fix datetime start/stop strings sometimes only showing the date and not the time

File Contents

# User Rev Content
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     }