date conversion

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

    #1

    date conversion

    Hi all, I'm trying to convert a simple date from:

    YYYYMMDD (20060613)

    to

    DD/MM/YYYY (13/06/2006)

    I'm reading the date command manual but I think is not ok for this
    issue.
    Can somebody tell me what command I can use?

    Cheers.

  • K.

    #2
    Re: date conversion


    Uzytkownik "PigInACage " <davide.papagno @gmail.comnapis al w wiadomosci
    news:1181304225 .872353.107920@ p47g2000hsd.goo glegroups.com.. .
    Hi all, I'm trying to convert a simple date from:
    >
    YYYYMMDD (20060613)
    >
    to
    >
    DD/MM/YYYY (13/06/2006)
    >
    I'm reading the date command manual but I think is not ok for this
    issue.
    Can somebody tell me what command I can use?
    >
    Cheers.
    >
    Try this one:

    $date is date variable

    date('d/m/Y',strtotime($d ate));

    Cheers
    Marcin


    Comment

    • PigInACage

      #3
      Re: date conversion

      GREAT!!

      Thanks.
      >
      Try this one:
      >
      $date is date variable
      >
      date('d/m/Y',strtotime($d ate));
      >
      Cheers
      Marcin

      Comment

      • Geoff Berrow

        #4
        Re: date conversion

        Message-ID: <1181306925.492 303.192110@p47g 2000hsd.googleg roups.comfrom
        PigInACage contained the following:
        >GREAT!!
        Once more, someone creates a completely ambiguous date.

        Sometimes a little knowledge can be a dangerous thing.

        --
        Geoff Berrow (put thecat out to email)
        It's only Usenet, no one dies.
        My opinions, not the committee's, mine.
        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

        Comment

        • Krustov

          #5
          Re: date conversion

          <comp.lang.ph p>
          <Geoff Berrow>
          <Fri, 08 Jun 2007 14:27:48 +0100>
          <p5mi6314qktqmn khhgmaic32vs44s qsc7r@4ax.com>
          Sometimes a little knowledge can be a dangerous thing.
          >
          It can also be a good thing as a little knowledge allowed me to write
          the code to create the faded bars for www.freeviewepg.co.uk instead of
          creating them manually in a image app .

          Although www.freeviewepg.co.uk/coming_up.php is probably a better
          example of the fade bars in use rather than whats on the home page .


          Hell even some of the variable names are sensible :-)



          $new_name="imag es/cu_bar_$tempbar .jpg";

          $pass=1;

          if (!file_exists($ new_name)) {$pass=0;}

          if ($pass==0)
          {

          $drawbar=$tempb ar;

          if ($tempbar==150) {$drawbar=149;}

          $source=imagecr eatetruecolor(1 50,18);

          $kol=imagecolor allocate($sourc e,254,254,254); imagefilledrect angle
          ($source,0,0,15 0,18,$kol);

          $kom=ImageColor Allocate($sourc e,244,244,244); ImageLine
          ($source,0,0,14 9,0,$kom);
          $kom=ImageColor Allocate($sourc e,244,244,244); ImageLine
          ($source,149,0, 149,18,$kom);
          $kom=ImageColor Allocate($sourc e,244,244,244); ImageLine
          ($source,0,18,1 49,18,$kom);

          $jt1=150; $jt2=190; $jt3=170;

          $dupp=0;

          while ($dupp<$drawbar )
          {
          $kap=ImageColor Allocate($sourc e,$jt1,$jt2,$jt 3); ImageLine($sour ce,
          $dupp,0,$dupp,1 8,$kap);
          if ($jt1<255) {$jt1=$jt1+1;}
          if ($jt2<255) {$jt2=$jt2+1;}
          if ($jt3<255) {$jt3=$jt3+1;}
          $dupp=$dupp+1;
          }

          if ($drawbar>30) {$kop=ImageColo rAllocate($sour ce,220,220,220) ;
          ImageLine($sour ce,30,0,30,18,$ kop);}
          if ($drawbar>60) {$kop=ImageColo rAllocate($sour ce,245,245,245) ;
          ImageLine($sour ce,60,0,60,18,$ kop);}

          $kom=ImageColor Allocate($sourc e,222,227,244); ImageLine($sour ce,0,0,
          $drawbar,0,$kom );
          $kom=ImageColor Allocate($sourc e,222,227,244); ImageLine
          ($source,0,0,0, 18,$kom);
          $kom=ImageColor Allocate($sourc e,222,227,244); ImageLine($sour ce,0,18,
          $drawbar,18,$ko m);

          ImageJPEG($sour ce,$new_name,90 );

          imagedestroy($s ource);

          }

          Comment

          • Geoff Berrow

            #6
            Re: date conversion

            Message-ID: <MPG.20d370c237 3e8d9298a974@ne ws.newsreader.c omfrom
            Krustov contained the following:
            >Although www.freeviewepg.co.uk/coming_up.php is probably a better
            >example of the fade bars in use rather than whats on the home page .
            Seems awfully complicated. And the fade is truncated, not resized.

            I'd have created one image and let the browser resize it. For simple
            stuff like that it would have done ok.

            --
            Geoff Berrow (put thecat out to email)
            It's only Usenet, no one dies.
            My opinions, not the committee's, mine.
            Simple RFDs http://www.ckdog.co.uk/rfdmaker/

            Comment

            • Krustov

              #7
              Re: date conversion

              <comp.lang.ph p>
              <Geoff Berrow>
              <Fri, 08 Jun 2007 16:56:23 +0100>
              <8tui63ds2ad4ri pb6u42p49p1fh2a egiu6@4ax.com>
              Although www.freeviewepg.co.uk/coming_up.php is probably a better
              example of the fade bars in use rather than whats on the home page .
              >
              Seems awfully complicated. And the fade is truncated, not resized.
              >
              I'd have created one image and let the browser resize it. For simple
              stuff like that it would have done ok.
              >
              Yeah i suppose a resized image would do job .

              But theres a faint horizontal line at 30 and 60 minutes and that effect
              couldnt be done with a resized image .

              If it wasnt for the fact i use the generated image as a background image
              i'd knock up the same page using a resized image just to compare the
              effect .

              Comment

              • Rami Elomaa

                #8
                Re: date conversion

                Geoff Berrow kirjoitti:
                Message-ID: <MPG.20d370c237 3e8d9298a974@ne ws.newsreader.c omfrom
                Krustov contained the following:
                >
                >Although www.freeviewepg.co.uk/coming_up.php is probably a better
                >example of the fade bars in use rather than whats on the home page .
                >
                Seems awfully complicated. And the fade is truncated, not resized.
                >
                I'd have created one image and let the browser resize it. For simple
                stuff like that it would have done ok.
                >
                I'd done it with css. Just set it as a background to a div that has a
                width of resize_factor*r unning_time, easy peasy. Creating a different
                image each and every time is slaying the serrver. In my opinion, use
                just one image, and other methods for controlling how much of it is
                displayed, such as css 'n friends.

                --
                Rami.Elomaa@gma il.com

                "Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
                usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze

                Comment

                • Krustov

                  #9
                  Re: date conversion

                  <comp.lang.ph p>
                  <Rami Elomaa>
                  <Fri, 08 Jun 2007 21:43:03 +0300>
                  <f4c7vo$fgq$1@n yytiset.pp.htv. fi>
                  Creating a different
                  image each and every time is slaying the serrver.
                  >
                  Its clear you didnt actually look at the code - or you dont understand
                  what it does or doesnt do .

                  Comment

                  • mypetprogrammer@gmail.com

                    #10
                    Re: date conversion

                    On Jun 8, 5:02 pm, Krustov <m...@privacy.n etwrote:
                    <comp.lang.ph p>
                    <Rami Elomaa>
                    <Fri, 08 Jun 2007 21:43:03 +0300>
                    <f4c7vo$fg...@n yytiset.pp.htv. fi>
                    >
                    Creating a different
                    image each and every time is slaying the serrver.
                    >
                    Its clear you didnt actually look at the code - or you dont understand
                    what it does or doesnt do .
                    And who cares? Move on, unless you want to just continue you having a
                    fight about style. Yeesh.

                    ~A!

                    Comment

                    Working...