Results 1 to 7 of 7

Thread: How to format Date (mm/dd/yyyy to dd/mm/yyyy)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Location
    Chennai,INDIA
    Posts
    6

    How to format Date (mm/dd/yyyy to dd/mm/yyyy)

    Hi,
    How to format Date (mm/dd/yyyy to dd/mm/yyyy) . Please help me.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: How to format Date (mm/dd/yyyy to dd/mm/yyyy)

    Moved from CodeBank (which is for examples, not questions)

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: How to format Date (mm/dd/yyyy to dd/mm/yyyy)

    sdDate = Format$(smDate, "dd/mm/yyyy")

    Where sdDate is a string variable that gets the date in dd/mm/yyyy format and smDate is a string variable having the date in mm/dd/yyyy format.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  4. #4
    Member
    Join Date
    Apr 2006
    Posts
    46

    Re: How to format Date (mm/dd/yyyy to dd/mm/yyyy)

    Quote Originally Posted by Al42
    sdDate = Format$(smDate, "dd/mm/yyyy")

    Where sdDate is a string variable that gets the date in dd/mm/yyyy format and smDate is a string variable having the date in mm/dd/yyyy format.
    This doesn't work. It still returns the format mm/dd/yyyy

  5. #5
    Hyperactive Member samsyl's Avatar
    Join Date
    Jun 2001
    Location
    London
    Posts
    338

    Re: How to format Date (mm/dd/yyyy to dd/mm/yyyy)

    use dis

    MsgBox Format(Date, "dd/MMM/yyyy")

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: How to format Date (mm/dd/yyyy to dd/mm/yyyy)

    How are you actually using it?

    Are you putting the value into a String variable (or a label caption etc), or are you putting it into a Date variable (which cannot contain formatting, so will use the default format).

  7. #7
    Member
    Join Date
    Apr 2006
    Posts
    46

    Re: How to format Date (mm/dd/yyyy to dd/mm/yyyy)

    I was applyng the format function to Date$ instead of Date

    That seemed to be the problem

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