dcsimg
Results 1 to 7 of 7

Thread: [RESOLVED] DtPicker long format

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    66

    Resolved [RESOLVED] DtPicker long format

    i set my dtpicker format to longdate (Monday, April 27, 2009)..
    i want to copy it in a textbox.. what code should i use? coz "text1 = dtpicker1.value" gives me this >>> 4/27/2009.. thanks in advance

  2. #2
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: DtPicker long format

    Code:
    Text1.Text = Format(DTPicker1.Value, "long date")
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    66

    Re: DtPicker long format

    thank you.. last question.. what if i want only this one >>> April 27, 2009

  4. #4
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: DtPicker long format

    Code:
    trim(mid(formatdatetime(now,vbLongDate),instr(formatdatetime(now,vbLongDate),",")+1))
    Good Luck
    Option Explicit should not be an Option!

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    66

    Re: DtPicker long format

    like this one? >>> Text1.Text = Format(DTP1.Value, Trim(Mid(FormatDateTime(Now, vbLongDate), InStr(FormatDateTime(Now, vbLongDate), ",") + 1))).... it gives me this result >>> April 28, 2399049... hehehe..

  6. #6
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: DtPicker long format

    what if i want only this one >>> April 27, 2009
    Text1.Text = Format$(DTPicker1.Value, "MMMM dd, yyyy")

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    66

    Re: DtPicker long format

    thanks bro...

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width