Results 1 to 3 of 3

Thread: date format

  1. #1
    Join Date
    Jan 2004
    Posts
    124

    Unanswered: date format

    I'm using FormatDateTime with vbLongDate in the following line:

    <%=FormatDateTime((rsBlogEntry.Fields.Item("blogDa te").Value), vbLongDate)%>

    Which returns the format:
    Wednesday, September 15, 2004

    I was looking at the different date formats and couldn't find one that drops the day and just returns:

    September 15, 2004

    Is there a way to format the date this way? Thanks.
    -Dman100-

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    byo - build your own.... unfortunately... try this...
    Code:
    Function FormatDmanDate(myDate)
      Dim sMonth, sDay, sYear, tmpDate
      sMonth = MonthName(Month(myDate), false)
      sDay = Day(myDate)
      sYear = Year(myDate)
      tmpDate = sMonth & " " & sDay & ", " & sYear
      FormatDManDate = tmpDate
    End Function
    should be close hopefully....

  3. #3
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Or you could split the original on the coma/space..

    Code:
    Dim newDate, dateArray
    newDate = FormatDateTime((rsBlogEntry.Fields.Item("blogDate").Value), vbLongDate)
    
    dateArray = Split(newDate, ", ")
    newDate = dateArray(1) & ", " & dateArray(2)
    Or go from the first occurance of the coma/space

    Code:
    Dim newDate
    newDate = FormatDateTime((rsBlogEntry.Fields.Item("blogDate").Value), vbLongDate)
    
    newDate = Mid(newDate, InStr(newDate, ", "), Len(newDate))
    Many ways to skin a cat!
    That which does not kill me postpones the inevitable.

Posting Permissions

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