Re: putting the current date in a mysql db

by "Gary Krockover" <gary(at)garykrockover.com>

 Date:  Sat, 17 Aug 2002 00:14:18 -0500
 To:  <hwg-techniques(at)mail.hwg.org>
 References:  jps
  todo: View Thread, Original
I can dig up a code example if you need it, but using a math function
add/subtract the appropriate hours from the time that your server is on to
get the time zone that your mother is in.

GK

> Say I'm trying to make my own little webblog app. In my browser, I'll type
> in my journal page for the day, and submit it. This would get sent to a
> mysql database, and I could retrieve it using a simple php script.
>
> I was pretty jazzed when i first discovered the now() function, as i
thought
> i could simply insert that into my database automatically, each time i
> submitted a journal page. Unfortunately, my server is in (i think) Japan,
so
> obviously, its 'now()' is different then my 'now'.
>
> Soooo, would it be easier/smarter to just use a hidden javascript Date()
> script, and send it along with the contents of my form to the db, or does
it
> make more sense to just subtract the correct date from the 'now()'
function?
>
> And only I (actually my mother), would be utilizing this journal entry
page,
> so non-javascript browsers arn't an issue. Though I would like to know the
> way most folks (would) do this.
>
> Sorry for probably such a cheesy question, and i DID google etc for an
> answer, but I wasn't able to do it by myself.
>
> as alwasy, tia,
>
> -Roger Harness
>

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA