Dating Problems (of the programming kind)

Results 1 to 2 of 2

Thread: Dating Problems (of the programming kind)

  1. #1
    Join Date
    Dec 1969

    Default Dating Problems (of the programming kind)

    simple problem, god **** i can&#039;t find the answer:<BR><BR>i need to save a full date, and time into a field in my Database. here&#039;s an example of an entry:<BR><BR>6/17/01 5:23:00 PM<BR><BR>now the full date, hour, and minutes are crucial, and i must retain those. however is there a way (because i&#039;ve tried building my own function for this) to either:<BR><BR>1) do something to the database so that it doesn&#039;t retain those seconds, but does keep the hours and minutes<BR><BR>or<BR><BR>2) a way to format them so when they&#039;re displayed, instead of seeing this:<BR><BR>6/17/01 5:23:00 PM<BR><BR>i&#039;d see this:<BR><BR>6/17/01 5:23 PM<BR><BR>this is a smart group out there, so lemme know what you&#039;ve got.<BR><BR>- Matt

  2. #2
    Join Date
    Dec 1969

    Default RE: Dating Problems (of the programming kind)

    Hour(Now) returns the hours... so you could say..<BR>Say your time and date is stored in X<BR>Dim X<BR>X = "6/17/01 5:23:00 PM"<BR>Dim dDate<BR>Dim intHour<BR>Dim intMinutes<BR>Dim strAmPm<BR><BR>dDate = Date(X)<BR>intHour = Hour(X)<BR>intMinutes = Minutes(X) &#039; minute(X) or minutes(X), i forget<BR>IF (intHour &#062; 11) Then<BR>strAmPm = "PM"<BR>Else:<BR>strAmPm = "AM"<BR>End If <BR><BR>Update the database with <BR>dDate & " " & intHour & ":" & intMinutes & " " & strAmPm<BR><BR>it may need some tweaking.. none of my code is guaranteed on the first try..<BR><BR>good luck!<BR><BR>Jason

Posting Permissions

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