Professional Web Applications Themes

dates from mysql - Coldfusion - Advanced Techniques

i store date in a mysql database, the data type is DATE in mysql which store the date in the format yyyy-mm-dd if I run a query with ColdFusion it will return that data as a time stamp. I don't understand why, for example {ts 1942-10-01 00:00:00'} why is ColdFusion change the data, this same data is stored as 1942-10-01 in MySQL. Does ColdFusion some how know the data type MySQL is using to store the data?...

  1. #1

    Default dates from mysql

    i store date in a mysql database, the data type is DATE in mysql which store
    the date in the format yyyy-mm-dd if I run a query with ColdFusion it will
    return that data as a time stamp. I don't understand why, for example {ts
    1942-10-01 00:00:00'} why is ColdFusion change the data, this same data is
    stored as 1942-10-01 in MySQL. Does ColdFusion some how know the data type
    MySQL is using to store the data?

    wfears Guest

  2. #2

    Default Re: dates from mysql

    if you store it in a date field and you call it up with just a set of
    <cfoutput> tags it will do that. I just use the function #DateFormat(date,
    "yyyy-mm-dd")# to format it as i need. If you saved it in a text or char field
    it would come up as you placed it in. Hope that helps.

    glossen Guest

  3. #3

    Default Re: dates from mysql

    ya thanks, I have been using the dateformat function, just trying to get some
    incite into how/way ColdFusion interacts with MySQL for example is it a
    MySQL/ColdFusion issue or does this happen with all DBMS, does MySQL send the
    data to ColdFusion in that format or does ColdFusion know it's a date and
    changes it?

    wfears Guest

  4. #4

    Default Re: dates from mysql

    As far as I know it is how Coldfusion interprets it. If your just bringing it up with cfoutput tags it is raw. If i remember correctly thats how access and mssql worked with cf as well.
    glossen Guest

Similar Threads

  1. MySQL compare dates
    By Ben in forum MySQL
    Replies: 4
    Last Post: April 19th, 09:57 AM
  2. MySQL Dates
    By cf101 in forum Coldfusion Database Access
    Replies: 3
    Last Post: August 5th, 06:13 PM
  3. Searching on Dates in MySQL
    By cf101 in forum Coldfusion - Getting Started
    Replies: 3
    Last Post: August 5th, 03:26 PM
  4. Web form dates to MySQL
    By Andy Burton in forum Dreamweaver AppDev
    Replies: 5
    Last Post: March 25th, 03:17 PM
  5. Array of Dates from MYSQL?...
    By rob in forum PHP Development
    Replies: 1
    Last Post: June 29th, 06:03 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139