Frmatting date returned from MYSQL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • joe soap

    Frmatting date returned from MYSQL

    HI all,

    How qould I format a date returned from a mysql database in the format of
    dd/mm/yyy

    Thanks
    Robert


  • Garp

    #2
    Re: Frmatting date returned from MYSQL


    "joe soap" <me@u.com> wrote in message
    news:geydnYFeIq EmPibdRVn-gw@is.co.za...[color=blue]
    > HI all,
    >
    > How qould I format a date returned from a mysql database in the format of
    > dd/mm/yyy
    >
    > Thanks
    > Robert[/color]

    A combination of strtotime() (to get a Julian date from a MySQL date format
    string) and date():



    I'll leave the exact implementation to you as an exercise...

    Garp


    Comment

    • joe soap

      #3
      Re: Frmatting date returned from MYSQL

      HI,

      Tank you very much.

      It was most helpfull

      Robert


      "Garp" <garp7@no7.blue yonder.co.uk> wrote in message
      news:ZxNuc.761$ hy1.6106203@new s-text.cableinet. net...[color=blue]
      >
      > "joe soap" <me@u.com> wrote in message
      > news:geydnYFeIq EmPibdRVn-gw@is.co.za...[color=green]
      > > HI all,
      > >
      > > How qould I format a date returned from a mysql database in the format[/color][/color]
      of[color=blue][color=green]
      > > dd/mm/yyy
      > >
      > > Thanks
      > > Robert[/color]
      >
      > A combination of strtotime() (to get a Julian date from a MySQL date[/color]
      format[color=blue]
      > string) and date():
      >
      > http://uk2.php.net/manual/en/function.date.php
      >
      > I'll leave the exact implementation to you as an exercise...
      >
      > Garp
      >
      >[/color]


      Comment

      • Tim Van Wassenhove

        #4
        Re: Frmatting date returned from MYSQL

        In article <geydnYFeIqEmPi bdRVn-gw@is.co.za>, joe soap wrote:[color=blue]
        > HI all,
        >
        > How qould I format a date returned from a mysql database in the format of
        > dd/mm/yyy[/color]

        Have a look at the DATE_FORMAT function in mysql manual

        --
        Tim Van Wassenhove <http://home.mysth.be/~timvw/contact.php>

        Comment

        • joe soap

          #5
          Re: Frmatting date returned from MYSQL

          Hi,

          Thanks, that might be a better solution.

          Robert

          "Tim Van Wassenhove" <euki@pi.be> wrote in message
          news:2i256uFi9t rtU1@uni-berlin.de...[color=blue]
          > In article <geydnYFeIqEmPi bdRVn-gw@is.co.za>, joe soap wrote:[color=green]
          > > HI all,
          > >
          > > How qould I format a date returned from a mysql database in the format[/color][/color]
          of[color=blue][color=green]
          > > dd/mm/yyy[/color]
          >
          > Have a look at the DATE_FORMAT function in mysql manual
          >
          > --
          > Tim Van Wassenhove <http://home.mysth.be/~timvw/contact.php>[/color]


          Comment

          • Garp

            #6
            Re: Frmatting date returned from MYSQL

            [top-post fixed]

            "joe soap" <me@u.com> wrote in message
            news:Td6dnV8EmI 8BRCHdRVn-hA@is.co.za...
            [color=blue]
            > "Tim Van Wassenhove" <euki@pi.be> wrote in message
            > news:2i256uFi9t rtU1@uni-berlin.de...[color=green]
            > > In article <geydnYFeIqEmPi bdRVn-gw@is.co.za>, joe soap wrote:[color=darkred]
            > > > HI all,
            > > >
            > > > How qould I format a date returned from a mysql database in the format[/color][/color]
            > of[color=green][color=darkred]
            > > > dd/mm/yyy[/color]
            > >
            > > Have a look at the DATE_FORMAT function in mysql manual
            > >
            > > --
            > > Tim Van Wassenhove <http://home.mysth.be/~timvw/contact.php>[/color]
            >
            >
            > Hi,
            >
            > Thanks, that might be a better solution.
            >
            > Robert[/color]

            I agree. If you don't have to support multiple database engines, at least.

            Garp


            Comment

            • rb

              #7
              Re: Frmatting date returned from MYSQL

              HI,[color=blue]
              >
              > I agree. If you don't have to support multiple database engines, at least.
              >
              > Garp
              >[/color]
              Well for the time being and this particular app, it is just MYSQL

              Robert


              Comment

              Working...