Working with Dates

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hannoudw
    New Member
    • Aug 2010
    • 115

    Working with Dates

    @ NeoPa
    I just have a question if we saved the Date as mm/dd/yyyy how can we change it then to this format (dd/mm/yyyy)?
    Or we should change the format before inserting the date in the database? Thanks for advanced
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32662

    #2
    This question relates to the article (Literal DateTimes and Their Delimiters (#)).

    The question you ask makes no sense. This sounds harsh, but I want to explain why. Then you will understand the whole subject more clearly.

    The clue is in the title :
    Literal DateTimes and Their Delimiters (#)

    There is a big difference between a date stored inside the computer (as a Date/Time) and a string which may represent a date. It's hard to distinguish sometimes, as to see and understand a date value on the screen it must first be converted to a string. Hence the Format property of numeric and date fields. However, there is a fundamental difference between a date value that happens to be displayed on the screen in "m/d/yyyy" format, and a string literal that shows the same characters.

    A date is never stored as "m/d/yyyy" or "d/m/yyyy". That wouldn't make sense as date fields are numeric and cannot contain string values. Dates are all stored the same way inside your field. Regardless of what default or explicit format properties you may employ.

    Does this understanding help you to grasp the issue? If so, you will understand why I can't answer your question directly.

    Comment

    Working...