Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8642543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:48:13+00:00 2026-06-12T11:48:13+00:00

Quick question for an ASP experts out there! I am reading a SQL database

  • 0

Quick question for an ASP experts out there! I am reading a SQL database using ASP. The fieldtype in SQL is “datetime” ie. 2012-08-15 08:08:20.140

However when I read this via Classic ASP ADODB RecordSet I get “15/08/2012”. This is slightly un-helpful as I would like it to read in in the exact same format as it appears on SQL Server.

Is there any way I can stop ASP changing the date and just read it in as it appears from SQL Server in YYYY-MM-DD format?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:48:14+00:00Added an answer on June 12, 2026 at 11:48 am

    You could use a combination of SetLocale and FormatDateTime.

    About SetLocale:
    http://www.w3schools.com/vbscript/func_setlocale.asp

    About FormatDateTime:
    http://www.w3schools.com/vbscript/func_formatdatetime.asp

    Here is an example:

    SetLocale 4105 ' 4105 => Canada, which is ISO-8601 (YYYY-MM-DD)
    
    SQL = "select user_date from user"
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.Open Application("ConnectionString")
    Set cmd = Server.CreateObject("ADODB.Command")
    cmd.ActiveConnection = conn
    cmd.CommandType = 1
    cmd.CommandText = SQL
    Set rst = Server.CreateObject("ADODB.Recordset")
    rst.CursorLocation = 3
    Set rst = cmd.Execute
    
    echo FormatDateTime(rst('user_date').Value,vbShortDate);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question on LINQ to SQL generated queries output. I am in a ASP.NET
Quick question, I was wondering if there is a way to use Solr's API
Quick question. How would you refactor this Asp.net MVC 2 HtmlHelper? Specifically would it
quick question. In my user database I have 5 separate tables all containing different
a quick question for an ASP.NET expert. It is an arguable moment for us
Quick question: How do you set defaultvalue with asp? Here is my code: <SelectParameters>
I got a quick question, I am building an ASP.NET website and have a
OK, here is the question, I have a asp.net website, there is an aspx
Using: ASP.NET 4, SQL 2008, C# I'm writing a web app for our projects
quick question :) I have an ASP.NET MVC view. I want the view to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.