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 9016947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:08:10+00:00 2026-06-16T04:08:10+00:00

I need to create a database which will hold some datetime values. So I

  • 0

I need to create a database which will hold some datetime values.

So I defined the column to be datetime type, and I have this calendar.

So, which should be the format of the calendar input in order for the date time to work?

Because I need to make some searches i.e

Select FROM table_name between date1 to date2

For the moment it is:

mm/dd/yyyy

I’m using this:

$today = date("dd/mm/yyyy");                  
$strSQL = "SELECT forma.*, SMS_MONTIME.IDTICKET, SMS_MONTIME.MBYLLUR,SMS_MONTIME.time_added
FROM forma 
LEFT JOIN SMS_MONTIME ON forma.ID = SMS_MONTIME.IDTICKET WHERE data_e_shitjes=$today";

Thanks

  • 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-16T04:08:13+00:00Added an answer on June 16, 2026 at 4:08 am

    There are many formats supported by SQL Server – see the MSDN Books Online on CAST and CONVERT. Most of those formats are dependant on what settings you have – therefore, these settings might work some times – and sometimes not.

    The way to solve this is to use the (slightly adapted) ISO-8601 date format that is supported by SQL Server – this format works always – regardless of your SQL Server language and dateformat settings.

    The ISO-8601 format is supported by SQL Server comes in two flavors:

    • YYYYMMDD for just dates (no time portion); note here: no dashes!, that’s very important! YYYY-MM-DD is NOT independent of the dateformat settings in your SQL Server and will NOT work in all situations!

    or:

    • YYYY-MM-DDTHH:MM:SS for dates and times – note here: this format has dashes (but they can be omitted), and a fixed T as delimiter between the date and time portion of your DATETIME.

    This is valid for SQL Server 2000 and newer.

    If you use SQL Server 2008 or newer and the DATE datatype (only DATE – not DATETIME!), then you can indeed also use the YYYY-MM-DD format and that will work, too, with any settings in your SQL Server.

    Don’t ask me why this whole topic is so tricky and somewhat confusing – that’s just the way it is. But with the YYYYMMDD format, you should be fine for any version of SQL Server and for any language and dateformat setting in your SQL Server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create module in Magento which will have few database tables. One
I need some advice regarding which database I should use. I want to create
I am trying to create a custom field type which will display values based
I need to create a script which will parse some data from a url
I have an SQL database which I need to create a procedure or query
I have the need to create a database for some data I have, and
I need to create a playlist in database, to know when each video will
I need to create a table that will combine two database tables together. Both
i need run code that will create a database and populate tables. i am
I'm writing a program which will need to create and make use of an

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.