Convert string to DateTime!!!

Results 1 to 3 of 3

Thread: Convert string to DateTime!!!

  1. #1
    Svetlana Guest

    Default Convert string to DateTime!!!

    Hello!<BR>When I get a value from MS SQL Server data base field with type datetime and then print it in HTML I see something like<BR>Tue Nov 14 11:48:49 UTC+0200 2000<BR><BR>But later I save that value to variable and need to write it in the field with type datetime. How can I convert that string value to datetime

  2. #2
    Join Date
    Dec 1969

    Default Maybe 8-)

    You could do this *if* you already know the format of the datetime being output:<BR><BR>&lt;%<BR>Dim myDate<BR>Dim arrDates<BR>Dim zeDay<BR>Dim zeMonth<BR>DIm zeYear<BR><BR>myDate = "Tue Nov 14 11:48:49 UTC+0200 2000"<BR><BR>arrDates = Split(myDate, " ")<BR><BR>zeDay = arrDates(2)<BR>zeMonth = arrDates(1)<BR>zeYear = arrDates(5)<BR><BR>Response.Write FormatDateTime(zeDay & "/" & zeMonth & "/" & zeYear, vbLongDate)<BR><BR>%&gt;<BR><BR><BR>HTH<BR>Darren< BR>

  3. #3
    Svetlana Guest

    Default Good idea but.........not for my case

    Good idea but I need to write that date variavle to database field with type datetime. <BR>I think there should be any converters for it. But where and how?

Posting Permissions

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