Results 1 to 3 of 3

Thread: datetime picker

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    13

    datetime picker

    i am using datetime picker in my form .
    but while select a date it is showing date in "mm/dd/yyyy" format .
    But i want date to be displayed in "dd/mm/YYYY" format .
    its very urgent

  2. #2
    Fanatic Member
    Join Date
    Feb 2007
    Location
    Eindhoven
    Posts
    828

    Re: datetime picker

    in the designer form,
    1 - select your datetimecontrol.
    2 - In the appearence section, change the format property to 'custom'
    3 - in the behavior sectionm set the customFormat property to the format you like

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: datetime picker

    The Format property of the DateTimePicker can be set to Long (default), Short, Time or Custom. The actual format of the first three is dictated by the system's Regional Settings, so the same date will display differently on two different systems with different regional settings. The idea is that every user sees dates, times and numbers in the format that they expect. Those in the US will see dates in M/dd/yyyy format while those of us here in Australia will see dates in d/MM/yyyy format. It's generally better to use system formats so each user gets what they expect.

    If you want to force a specific format regardless of regional settings, you set the Format to Custom and then set the CustomFormat to whatever you want. In your case you'd set the CustomFormat to d/MM/yyyy, or dd/MM/yyyy if you wanted to force a leading zero on single digit days. Note that the M's must be upper case and the rest lower case. Lower case m is for minutes.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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