date format in db and output on screen

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default date format in db and output on screen

    Hi,

    I have a form (step1) which inserts some data (serialnr and type and date as
    hidden field) into the database, then users are directed to another page
    (step2) where further details for the just inserted data can be inserted (like:
    location, user, and the just inserted values (in step 1) are displayed and can
    be adjusted.

    My question is:
    I use a MySQL database so the values for date have to be inserted like this:
    0000-00-00 (Y-M-D).
    I just give the form field a value like this:
    <cfoutput>#DateFormat(Now(), "YYYY-MM-DD")#</cfoutput>

    However in step2 the value needs to be displayed from the database. It is
    displayed like this:
    {ts '2005-10-04 00:00:00'} this is not right, does anyone know how i could get
    the values displayed in a normal way?

    Hopefully someone can help me.

    Thank you in advance,

    Kabbi


    kabbi~thkek Guest

  2. Similar Questions and Discussions

    1. Indesign CS will not export as a screen format
      I'm using Adobe Indesign CS Education version on Windows XP. I have a document, and whenever I try to export it to PDF as a "preset for screen" it...
    2. Format to save for Screen Printers?
      New to illustrator. I have EPS and JPG files from other packages I want to send to a printer. They told me that the "artwork needs to be vector based...
    3. output format select
      Hello! I have to export several tables from informix to sdf text format (all fields must be specific length, numeric fields must be right...
    4. converting date into database date format(newbie)
      Hi! U can convert "8-Aug-03" into mysql date which requires yyyy-mm-dd format as below. <?php date("Y-m-d",strtotime("8-Aug-03")); ?>
    5. grouping output to screen
      I'm able to run the following while in php admin, but I want to be able to run this from a php page and seethe results on the screen. Any...
  3. #2

    Default Re: date format in db and output on screen

    There are two ways. One is to use the Cold Fusion dateformat function after
    you select the field. The other, if mySql has such an animal, is to use a
    database function that converts dates to text. Oracle to_char is one example.

    Dan Bracuk Guest

  4. #3

    Default Re: date format in db and output on screen

    Just use the date format function again -
    DateFormat(myQuery.databaseDate, "YYYY-MM-DD")
    jdeline Guest

Posting Permissions

  • You may not post new threads
  • You may 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