Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Date/Time. Looked Everywhere. Can't Solve This. Urgent. Thank You.

Date/Time. Looked Everywhere. Can't Solve This. Urgent. Thank You.

Scheduled Pinned Locked Moved ASP.NET
questionhtmlcomdockerxml
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shapper
    wrote on last edited by
    #1

    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

    D P 2 Replies Last reply
    0
    • S shapper

      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

      D Offline
      D Offline
      DELETEUSER
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • S shapper

        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

        P Offline
        P Offline
        padvit
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups