mktime help - Jan, Feb......

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

    mktime help - Jan, Feb......

    PHP doesn't have ENUM and I'm inputting the date 14-SEP-2003 and
    I want to "insert into atable values ('2003-09-14', .........==> mysql.

    Anybody have a neet trick?

    Tks
    Chuck

  • Tom Thackrey

    #2
    Re: mktime help - Jan, Feb......


    On 15-Sep-2003, Cal Lidderdale <chuck@liderbug .com> wrote:
    [color=blue]
    > PHP doesn't have ENUM and I'm inputting the date 14-SEP-2003 and
    > I want to "insert into atable values ('2003-09-14', .........==> mysql.
    >
    > Anybody have a neet trick?[/color]

    $mysqldate = date('Y-m-d',strtotime('1 4-sep-2003'));

    --
    Tom Thackrey

    Comment

    • BKDotCom

      #3
      Re: mktime help - Jan, Feb......

      how does this problem concern ENUM?

      strtotime() will return a timestamp... if it's a date column.. just
      insert the timestamp..
      'insert into atable values ('.strtotime('1 4-SEP-2003').',...... ...'

      Cal Lidderdale <chuck@liderbug .com> wrote in message news:<Wxn9b.241 $ep1.24799@news .uswest.net>...[color=blue]
      > PHP doesn't have ENUM and I'm inputting the date 14-SEP-2003 and
      > I want to "insert into atable values ('2003-09-14', .........==> mysql.
      >
      > Anybody have a neet trick?
      >
      > Tks
      > Chuck[/color]

      Comment

      • Alex Farran

        #4
        Re: mktime help - Jan, Feb......

        Tom Thackrey writes:
        [color=blue]
        > $mysqldate = date('Y-m-d',strtotime('1 4-sep-2003'));[/color]

        Strtotime represents time as the number of seconds since Jan 1st 1970.
        The upper limit is in 2038 I think. If you want to represent dates
        outside of this range you can't use this method to format them.

        --

        __o Alex Farran
        _`\<,_ Analyst / Programmer
        (_)/ (_) www.alexfarran.com

        Comment

        • Tom Thackrey

          #5
          Re: mktime help - Jan, Feb......


          On 16-Sep-2003, Alex Farran <alex@alexfarra n.com> wrote:
          [color=blue]
          > Tom Thackrey writes:
          >[color=green]
          > > $mysqldate = date('Y-m-d',strtotime('1 4-sep-2003'));[/color]
          >
          > Strtotime represents time as the number of seconds since Jan 1st 1970.
          > The upper limit is in 2038 I think. If you want to represent dates
          > outside of this range you can't use this method to format them.[/color]

          The year 2003 is well within the range ;-)

          If you need dates outside the unix time stamp range try:


          --
          Tom Thackrey

          Comment

          Working...