ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/xmltv_parser/trunk/libxmltv/Extensions.cs
Revision: 159
Committed: Thu Mar 14 20:26:05 2013 UTC (9 years, 10 months ago) by william
File size: 912 byte(s)
Log Message:

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 william 159 public static class DateTimeStringConverter
9 william 141 {
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     }