Results 1 to 2 of 2

Thread: Date Format

  1. #1

    Thread Starter
    Hyperactive Member buddu's Avatar
    Join Date
    Jul 2001
    Location
    India
    Posts
    446

    Date Format

    hi to all
    i have text box named it as txtFdate
    Code:
    <input id="txtFromDate" tabindex="3" type="text" onchange="OnChangeClientSide()" size="12" runat="server" />
    here i am just entering the value like 01-05-2002. So i need to Chage this into DateFormat so that i can insert into Database.

    is there anything like txtFromDate.Format('mm/dd/yyyy')

    any Help...?
    prasad

  2. #2
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    If you convert the text string to a Date data type, you can format the Date Datatype in numerous ways with it's tostring method.

    Examples-
    VB Code:
    1. Dim strSetting as String
    2.       Dim datDate As Date
    3.       strSetting = "05-02-2002"
    4.       datDate = CType(strSetting, Date)
    5.       strSetting = datDate.Tostring("dd/MM/YYYY")
    6.       strSetting = datDate.Tostring("dddd - d - mmm)

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