CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: date formatting

  1. #1
    Guest

    date formatting

    I'm having some trouble with formatting a date. I have a varible v_date that contains 9Aug99. I want it to look like this 09-Aug-1999, so here is the code I'm using. v_new_date = format(v_date, "dd-mmm-yyyy"). But what I get is this
    9Aug1999. How do I correct this?


  2. #2
    Join Date
    Aug 1999
    Location
    India-Delhi
    Posts
    106

    Re: date formatting

    Hi,

    The reason is:

    The VB is NOT able to recognise it as a date.
    Please use IsDate Function to exactly make sure that system recognise the date. Although you syntax is right. In case of you can user to write the date in your format then you have to write a small function which will convert your text into a standard text format.

    Thanks.



    Santulan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured