DATE HELP QUICKLY

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

    #1

    DATE HELP QUICKLY

    i have a site that displays shows. i am getting my date from a mysql
    function "CURDATE()" but it give me the date one day ahead of the
    actual date. i tried $myrow[8] -1 but that doen't work. im sure iknow
    what to do but its not hitting the brain right now. and the client
    wants a fix asap please help
    thanks
  • Peter Jones

    #2
    Re: DATE HELP QUICKLY

    xeatr1@aol.com (todd) wrote in
    news:4c604830.0 308231900.26c60 6be@posting.goo gle.com:
    [color=blue]
    > i have a site that displays shows. i am getting my date from a mysql
    > function "CURDATE()" but it give me the date one day ahead of the
    > actual date. i tried $myrow[8] -1 but that doen't work. im sure iknow
    > what to do but its not hitting the brain right now. and the client
    > wants a fix asap please help
    > thanks[/color]

    Set the time correctly on the server?

    More to the point, if the time on the server is out by (say) 16 hours
    (because of timezone differences or reading time in GMT or something)
    you could always modify it by using SELECT SUBDATE(CURDATE (),INTERVAL 16
    HOUR) -- which then returns a full timestamp, so SUBDATE(NOW(),. ..) may
    be more accurate...

    Of course, if all you want is to subtract 1 day,
    SUBDATE(CURDATE (),INTERVAL 1 DAY) will do it.

    Pete.

    Comment

    • todd

      #3
      Re: DATE HELP QUICKLY

      Peter Jones <jonespr@optush ome.com.au> wrote in message news:<Xns93E195 CE99FBDprjpp151 6202119@210.49. 20.254>...[color=blue]
      > xeatr1@aol.com (todd) wrote in
      > news:4c604830.0 308231900.26c60 6be@posting.goo gle.com:
      >[color=green]
      > > i have a site that displays shows. i am getting my date from a mysql
      > > function "CURDATE()" but it give me the date one day ahead of the
      > > actual date. i tried $myrow[8] -1 but that doen't work. im sure iknow
      > > what to do but its not hitting the brain right now. and the client
      > > wants a fix asap please help
      > > thanks[/color]
      >
      > Set the time correctly on the server?
      >
      > More to the point, if the time on the server is out by (say) 16 hours
      > (because of timezone differences or reading time in GMT or something)
      > you could always modify it by using SELECT SUBDATE(CURDATE (),INTERVAL 16
      > HOUR) -- which then returns a full timestamp, so SUBDATE(NOW(),. ..) may
      > be more accurate...
      >
      > Of course, if all you want is to subtract 1 day,
      > SUBDATE(CURDATE (),INTERVAL 1 DAY) will do it.
      >
      > Pete.[/color]

      you are an absoulte life saver THANKS!!!

      Comment

      • Peter Jones

        #4
        Re: DATE HELP QUICKLY

        xeatr1@aol.com (todd) wrote in
        news:4c604830.0 308251931.6e58f 249@posting.goo gle.com:
        [color=blue]
        > you are an absoulte life saver THANKS!!![/color]

        No problem,
        Pete.

        Comment

        Working...