<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Converter for Time Only</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Converter for Time Only</description>
  <pubDate>Sun, 12 Apr 2026 17:32:56 -700</pubDate>
  <lastBuildDate>Mon, 16 Jul 2007 11:16:24 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=267</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Converter for Time Only : Try this:  http://msdn.micro...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=267&amp;PID=592#592</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 267<br /><strong>Posted:</strong> 16-Jul-2007 at 11:16am<br /><br /><DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN =437084602-20032007>Try this:</SPAN></FONT></DIV><DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN =437084602-20032007></SPAN></FONT>&nbsp;</DIV><DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN =437084602-20032007><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpc&#111;nstandarddatetime&#102;ormatstrings.asp" target="_blank">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandarddatetimeformatstrings.asp</A></SPAN></FONT></DIV><DIV>&nbsp;</DIV><DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV><DIV><FONT face=Arial color=#0000ff size=2><DIV id=nsbanner><DIV id=bannerrow1><TABLE =bannerpart cellSpacing=0><T><TR id=hdr><TD =running noWrap>.NET&nbsp;Framework&nbsp;Developer's&nbsp;Guide</TD><TD =product noWrap>&nbsp;</TD></TR></T></TABLE></DIV><DIV id=TitleRow><H1 =dtH1><A name=cpc&#111;nstandarddatetimeatstrings></A>Standard DateTime Format Strings</H1></DIV></DIV><!--N&#079;NSCROLLING BANNER END--><DIV id=nstext valign="bottom"><DIV =saveHistory id=allHistory &#111;nload="loadAll()" &#111;nsave="saveAll()"></DIV><P>A standard <B>DateTime</B> format string consists of a single format specifier character from the following table. If the format specifier is not found in the table below, a runtime exception is thrown. If the format string is longer than a single character (even if the extra characters are white spaces), the format string is interpreted as a custom format string. </P><P>Note that the result string produced by these format specifiers are influenced by the settings in the Regional Options control panel. Computers with different cultures or different date and time settings will generate different result strings.</P><P>The date and time separators displayed by format strings are defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassDateSeparatorTopic.asp" target="_blank"><FONT face=Arial size=2>DateSeparator</FONT></A> and <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassTimeSeparatorTopic.asp" target="_blank"><FONT face=Arial size=2>TimeSeparator</FONT></A> characters associated with the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassTopic.asp" target="_blank"><FONT face=Arial size=2>DateTimeFormat</FONT></A> property of the current culture. However, in cases where the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nCultureInfoClassInvariantCultureTopic.asp" target="_blank"><FONT face=Arial size=2>InvariantCulture</FONT></A> is referenced by the 'r', 's', and 'u' specifiers, the characters associated with the <B>DateSeparator</B> and <B>TimeSeparator </B>characters do not change based on the current culture. </P><P>The following table describes the standard format specifiers for formatting the <B>DateTime </B>object.</P><DIV =tablediv><TABLE =dtTABLE cellSpacing=0><T><TR vAlign=top><TH width="12%">Format specifier</TH><TH width="22%">Name</TH><TH width="66%">Description</TH></TR><TR vAlign=top><TD width="12%">d</TD><TD width="22%">Short date pattern</TD><TD width="66%">Displays a pattern defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassShortDatePatternTopic.asp" target="_blank"><FONT face=Arial size=3>DateTimeFormatInfo.ShortDatePattern</FONT></A> property associated with the current thread or by a specified format provider.</TD></TR><TR vAlign=top><TD width="12%">D</TD><TD width="22%">Long date pattern</TD><TD width="66%">Displays a pattern defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassL&#111;ngDatePatternTopic.asp" target="_blank"><FONT face=Arial size=3>DateTimeFormatInfo.LongDatePattern</FONT></A> property associated with the current thread or by a specified format provider.</TD></TR><TR vAlign=top><TD width="12%">t</TD><TD width="22%">Short time pattern</TD><TD width="66%">Displays a pattern defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassShortTimePatternTopic.asp" target="_blank"><FONT face=Arial size=3>DateTimeFormatInfo.ShortTimePattern</FONT></A> property associated with the current thread or by a specified format provider.</TD></TR><TR vAlign=top><TD width="12%">T</TD><TD width="22%">Long time pattern</TD><TD width="66%">Displays a pattern defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassL&#111;ngTimePatternTopic.asp" target="_blank"><FONT face=Arial size=3>DateTimeFormatInfo.LongTimePattern</FONT></A> property associated with the current thread or by a specified format provider.</TD></TR><TR vAlign=top><TD width="12%">f</TD><TD width="22%">Full date/time pattern (short time)</TD><TD width="66%">Displays a combination of the long date and short time patterns, separated by a space.</TD></TR><TR vAlign=top><TD width="12%">F</TD><TD width="22%">Full date/time pattern (long time)</TD><TD width="66%">Displays a pattern defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassFullDateTimePatternTopic.asp" target="_blank"><FONT face=Arial size=3>DateTimeFormatInfo.FullDateTimePattern</FONT></A> property associated with the current thread or by a specified format provider.</TD></TR><TR vAlign=top><TD width="12%">g</TD><TD width="22%">General date/time pattern (short time)</TD><TD width="66%">Displays a combination of the short date and short time patterns, separated by a space.</TD></TR><TR vAlign=top><TD width="12%">G</TD><TD width="22%">General date/time pattern (long time)</TD><TD width="66%">Displays a combination of the short date and long time patterns, separated by a space.</TD></TR><TR vAlign=top><TD width="12%">M or m</TD><TD width="22%">Month day pattern</TD><TD width="66%">Displays a pattern defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassM&#111;nthDayPatternTopic.asp" target="_blank"><FONT face=Arial size=3>DateTimeFormatInfo.MonthDayPattern</FONT></A> property associated with the current thread or by a specified format provider.</TD></TR><TR vAlign=top><TD width="12%">R or r</TD><TD width="22%">RFC1123 pattern</TD><TD width="66%">Displays a pattern defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassRFC1123PatternTopic.asp" target="_blank"><FONT face=Arial size=3>DateTimeFormatInfo.RFC1123Pattern</FONT></A> property associated with the current thread or by a specified format provider. This is a defined standard and the property is read-only; therefore, it is always the same regardless of the culture used, or the format provider supplied. The property references the <B>CultureInfo.InvariantCulture</B> property and follows the custom pattern "ddd, dd MMM yyyy HH:mm:ss G\MT". Note that the 'M' in "GMT" needs an escape character so it is not interpreted. Formatting does not modify the value of the <B>DateTime</B>; therefore, you must adjust the value to GMT before formatting.</TD></TR><TR vAlign=top><TD width="12%">s</TD><TD width="22%">Sortable date/time pattern; conforms to ISO 8601</TD><TD width="66%">Displays a pattern defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassSortableDateTimePatternTopic.asp" target="_blank"><FONT face=Arial size=3>DateTimeFormatInfo.SortableDateTimePattern</FONT></A> property associated with the current thread or by a specified format provider. The property references the <B>CultureInfo.InvariantCulture</B> property, and the format follows the custom pattern "yyyy-MM-ddTHH:mm:ss".</TD></TR><TR vAlign=top><TD width="12%">u</TD><TD width="22%">Universal sortable date/time pattern</TD><TD width="66%">Displays a pattern defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassUniversalSortableDateTimePatternTopic.asp" target="_blank"><FONT face=Arial size=3>DateTimeFormatInfo.UniversalSortableDateTimePattern</FONT></A> property associated with the current thread or by a specified format provider. Because it is a defined standard and the property is read-only, the pattern is always the same regardless of culture or format provider. Formatting follows the custom pattern "yyyy-MM-dd HH:mm:ssZ". No time zone conversion is done when the date and time is formatted; therefore, convert a local date and time to universal time before using this format specifier. </TD></TR><TR vAlign=top><TD width="12%">U</TD><TD width="22%">Universal sortable date/time pattern</TD><TD width="66%">Displays a pattern defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassFullDateTimePatternTopic.asp" target="_blank"><FONT face=Arial size=3>DateTimeFormatInfo.FullDateTimePattern</FONT></A> property associated with the current thread or by a specified format provider. Note that the time displayed is for the universal, rather than local time.</TD></TR><TR vAlign=top><TD width="12%">Y or y</TD><TD width="22%">Year month pattern</TD><TD width="66%">Displays a pattern defined by the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGlobalizati&#111;nDateTime&#070;ormatInfoClassYearM&#111;nthPatternTopic.asp" target="_blank"><FONT face=Arial size=3>DateTimeFormatInfo.YearMonthPattern</FONT></A> property associated with the current thread or by a specified format provider.</TD></TR><TR vAlign=top><TD width="12%">Any other single character</TD><TD width="22%">Unknown specifier</TD><TD width="66%">&nbsp;&nbsp;&nbsp;</TD></TR></T></TABLE></DIV><P>The following example illustrates how to use the standard format strings with <B>DateTime</B> objects.</P><PRE =code><FONT size=3><SPAN =lang>&#091;Visual&nbsp;Basic&#093;</SPAN>Dim dt As DateTime = DateTime.NowDim dfi As DateTimeFormatInfo = New DateTimeFormatInfo()Dim ci As CultureInfo = New CultureInfo("de-DE")' Make up a new custom DateTime pattern, for demonstration.dfi.MonthDayPattern = "MM-MMMM, ddd-dddd"' Use the DateTimeFormat from the culture associated ' with the current thread.Console.WriteLine( dt.ToString("d") )  Console.WriteLine( dt.ToString("m") )' Use the DateTimeFormat from the specific culture passed.Console.WriteLine( dt.ToString("d", ci ) )' Use the settings from the DateTimeFormatInfo object passed.Console.WriteLine( dt.ToString("m", dfi ) )' Reset the current thread to a different culture.Thread.CurrentThread.CurrentCulture = New CultureInfo("fr-BE")Console.WriteLine( dt.ToString("d") )</FONT><FONT size=3><SPAN =lang>&#091;C#&#093;</SPAN>DateTime dt = DateTime.Now;DateTimeFormatInfo dfi = new DateTimeFormatInfo();CultureInfo ci = new CultureInfo("de-DE");// Make up a new custom DateTime pattern, for demonstration.dfi.MonthDayPattern = "MM-MMMM, ddd-dddd";// Use the DateTimeFormat from the culture associated // with the current thread.Console.WriteLine( dt.ToString("d") );  Console.WriteLine( dt.ToString("m") );// Use the DateTimeFormat from the specific culture passed.Console.WriteLine( dt.ToString("d", ci ) );// Use the settings from the DateTimeFormatInfo object passed.Console.WriteLine( dt.ToString("m", dfi ) );// Reset the current thread to a different culture.Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-BE");Console.WriteLine( dt.ToString("d") );</FONT></PRE></DIV></FONT></DIV><DIV><BR></DIV><P><BR>&nbsp;</P>]]>
   </description>
   <pubDate>Mon, 16 Jul 2007 11:16:24 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=267&amp;PID=592#592</guid>
  </item> 
  <item>
   <title>Converter for Time Only : 1) I notice that the default DevForce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=267&amp;PID=591#591</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=20" rel="nofollow">Customer</a><br /><strong>Subject:</strong> 267<br /><strong>Posted:</strong> 16-Jul-2007 at 11:15am<br /><br />1) I notice that the default DevForce DataConverters has both a <BR><BR><FONT face="Courier New" color=#008080 size=2>DataConverter</FONT><FONT face="Courier New" size=2>.ReadOnlyDateTime</FONT><FONT face=sans-serif size=2> and </FONT><FONT face="Courier New" color=#008080 size=2>DataConverter</FONT><FONT face="Courier New" size=2>.ReadOnlyDate</FONT> <BR><BR><FONT face=sans-serif size=2>but there's no </FONT><FONT face="Courier New" color=#008080 size=2><B>DataConverter</B></FONT><FONT face="Courier New" size=2><B>.ReadOnlyTime</B></FONT> <BR><BR><FONT face="Courier New" size=2>Would you have a code snippet for a custom converter? We have a <B>Converters </B>class for our various custom converters (mostly list converters).</FONT> <BR><BR><FONT face="Courier New" color=#008080 size=2>I'm trying to do something like this:</FONT> <BR><BR><FONT face="Courier New" color=#008080 size=2>XtraGridBindingDescriptor</FONT><FONT face="Courier New" size=2> bdLastModDttm = appointmentXtraGridBM.Descriptors.Add(</FONT><FONT face="Courier New" color=#800000 size=2>"LastModDttm"</FONT><FONT face="Courier New" size=2>, prefix + </FONT><FONT face="Courier New" color=#008080 size=2>ActivityLog</FONT><FONT face="Courier New" size=2>.LastModDttmEntityColumn.ColumnName, </FONT><FONT face="Courier New" color=#008080 size=2>DataConverter</FONT><FONT face="Courier New" size=2>.ReadOnlyDateReadOnlyDateTime);</FONT> <BR><BR><FONT face="Courier New" size=2><U>prefix + </U></FONT><FONT face="Courier New" color=#008080 size=2><U>ActivityLog</U></FONT><FONT face="Courier New" size=2><U>.LastModDttmEntityColumn.ColumnName</U> is a DateTime property that I simply want to display in my grid as a Time value.</FONT> <BR><BR>]]>
   </description>
   <pubDate>Mon, 16 Jul 2007 11:15:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=267&amp;PID=591#591</guid>
  </item> 
 </channel>
</rss>