Date/Time. Looked Everywhere. Can't Solve This. Urgent. Thank You.
-
Hello, I created a dataset from a XML file. One of the dataset fields is [pubDate]. In an ASP:Repeater I am displaying the [pubDate] field. <%# DataBinder.Eval(Container.DataItem, "pubDate", "{0:f}") %> The date displayed has the following format, the same as in the XML file: Fri, 20 May 2005 12:30:00 GMT I also tried "{0:F}", "{0:g}") as in: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafmtnameddateformats.asp I am not able to change the date format. Even when I change culture the date weekday and month don't change. It seems the dataset is not recognizing the [pubDate] as date/time... Maybe this column is formated as string and not as date/time? How can I check that? I have been trying to solve this for the past 2 days. I am completly lost. Can someone help me? Thanks, Miguel
-
Hello, I created a dataset from a XML file. One of the dataset fields is [pubDate]. In an ASP:Repeater I am displaying the [pubDate] field. <%# DataBinder.Eval(Container.DataItem, "pubDate", "{0:f}") %> The date displayed has the following format, the same as in the XML file: Fri, 20 May 2005 12:30:00 GMT I also tried "{0:F}", "{0:g}") as in: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafmtnameddateformats.asp I am not able to change the date format. Even when I change culture the date weekday and month don't change. It seems the dataset is not recognizing the [pubDate] as date/time... Maybe this column is formated as string and not as date/time? How can I check that? I have been trying to solve this for the past 2 days. I am completly lost. Can someone help me? Thanks, Miguel
I'm not sure about VB.Net , but in C# I have done Date.Time.Now.ToString("G"). What I'm trying to tell is that if the column is formmated as string why don't you convert the DateTime to string in the format you want? ---------- Venus Patel http://patelsinc.blogspot.com/ A student knows little about a lot. A professor knows a lot about little. I know everything about nothing.
-
Hello, I created a dataset from a XML file. One of the dataset fields is [pubDate]. In an ASP:Repeater I am displaying the [pubDate] field. <%# DataBinder.Eval(Container.DataItem, "pubDate", "{0:f}") %> The date displayed has the following format, the same as in the XML file: Fri, 20 May 2005 12:30:00 GMT I also tried "{0:F}", "{0:g}") as in: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafmtnameddateformats.asp I am not able to change the date format. Even when I change culture the date weekday and month don't change. It seems the dataset is not recognizing the [pubDate] as date/time... Maybe this column is formated as string and not as date/time? How can I check that? I have been trying to solve this for the past 2 days. I am completly lost. Can someone help me? Thanks, Miguel
Hi Please try out this in this way take a grid had a column to it programmtically and sent format string for each column either find out column no which is datetime and set dataformat string for that column like this strFormat = "{0:g}" this might help you out Padvit