Date conversion woes

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

    Date conversion woes

    Using either MySQL functions or PHP, how can I convert a date filed in the
    format of (varchar)

    Aug 10, 1950

    to a unix timestamp?

    tia


  • News Me

    #2
    Re: Date conversion woes

    Raven wrote:[color=blue]
    > Using either MySQL functions or PHP, how can I convert a date filed in the
    > format of (varchar)
    >
    > Aug 10, 1950
    >
    > to a unix timestamp?
    >
    > tia
    >
    >[/color]

    I believe Unix timestamps are calculated as seconds since January 1,
    1970. That being the case, you can't convert dates with years prior to
    1970 to Unix timestamps.

    NM

    Comment

    • Raven

      #3
      Re: Date conversion woes

      "News Me" <newsTWOme@paci fierDOTcom> wrote in message
      news:10tequcofs hcc01@corp.supe rnews.com...[color=blue]
      > Raven wrote:[color=green]
      >> Using either MySQL functions or PHP, how can I convert a date filed in
      >> the format of (varchar)
      >>
      >> Aug 10, 1950
      >>
      >> to a unix timestamp?
      >>
      >> tia[/color]
      >
      > I believe Unix timestamps are calculated as seconds since January 1, 1970.
      > That being the case, you can't convert dates with years prior to 1970 to
      > Unix timestamps.
      >
      > NM[/color]


      Correct, I just meant to give a representation of a pattern, not the real
      data. I found the easy way with PHP. It would be nice if there was a
      direct way with MySQL. Thanks.


      Comment

      • Jan Pieter Kunst

        #4
        Re: Date conversion woes

        > Raven wrote:[color=blue]
        >[color=green]
        >> Using either MySQL functions or PHP, how can I convert a date filed in
        >> the format of (varchar)
        >>
        >> Aug 10, 1950
        >>
        >> to a unix timestamp?
        >>
        >> tia[/color][/color]

        I use the PEAR package 'Date' to work with dates before 1970.

        <http://pear.php.net/package/Date>

        JP

        --
        Sorry, <devnull@cauce. org> is a spam trap.
        Real e-mail address unavailable. 5000+ spams per month.

        Comment

        • Mick White

          #5
          Re: Date conversion woes

          News Me wrote:
          [color=blue]
          >
          > I believe Unix timestamps are calculated as seconds since January 1,
          > 1970. That being the case, you can't convert dates with years prior to
          > 1970 to Unix timestamps.
          >[/color]

          There is no such thing as a negative Unix timestamp?
          Mick

          Comment

          Working...